# Adds two complex numbers and returns the result. : Complex « Data Types « C# / C Sharp

Home
C# / C Sharp
 1 2D Graphics 2 Class Interface 3 Collections Data Structure 4 Components 5 Data Types 6 Database ADO.net 7 Date Time 8 Design Patterns 9 Development Class 10 Event 11 File Stream 12 Generics 13 GUI Windows Form 14 Internationalization I18N 15 Language Basics 16 LINQ 17 Network 18 Office 19 Reflection 20 Regular Expressions 21 Security 22 Services Event 23 Thread 24 Web Services 25 Windows 26 Windows Presentation Foundation 27 XML 28 XML LINQ
 C# / C Sharp » Data Types » Complex Screenshots
Adds two complex numbers and returns the result.
 ```  using System; using System.Numerics; public class Example {    public static void Main()    {       Complex[] values= { new Complex(12.3, -1.4),                            new Complex(8.9, 1.5) };          foreach (var c1 in values)          foreach (var c2 in values)             Console.WriteLine("{0} + {1} = {2}", c1, c2,                                Complex.Add(c1, c2));    } }       ```
Related examples in the same category
 1 A Complex Number Class 2 Complex number class 3 Class to do math on complex numbers. 4 Initializes a new instance of the Complex structure using the specified real and imaginary values. 5 Complex Structure represents a complex number. 6 Assign a Double to a complex number 7 Cast a Decimal to a complex number 8 Assign the return value of a method to a Complex variable 9 Assign the value returned by an operator to a Complex variable 10 Instantiate a complex number from its polar coordinates 11 Complex.Exp 12 Complex.Sqrt 13 Divide and multiply 14 Gets the absolute value (or magnitude) of a complex number. 15 Returns the angle that is the arc cosine of the specified complex number. 16 Adds two complex numbers. 17 Returns the angle that is the arc sine of the specified complex number. 18 Returns the angle that is the arc tangent of the specified complex number. 19 Computes the conjugate of a complex number and returns the result. 20 Divides one complex number by another and returns the result. 21 Returns a value that indicates whether the current instance and a specified complex number have the same value. 22 Returns e raised to the power specified by a complex number. 23 Creates a complex number from a point's polar coordinates. 24 Gets the imaginary component of the current Complex object. 25 Returns a new Complex instance with a real number equal to zero and an imaginary number equal to one. 26 Returns the product of two complex numbers. 27 Returns the additive inverse of a specified complex number. 28 Returns a new Complex instance with a real number equal to one and an imaginary number equal to zero. 29 Returns a specified complex number raised to a power specified by a double-precision floating-point number. 30 Returns the multiplicative inverse of a complex number. 31 Subtracts one complex number from another and returns the result. 32 Converts current complex number to string in Cartesian form by using the specified culture-specific formatting information. 33 Converts current complex number to string in Cartesian form by using the specified format for its real and imaginary parts. 34 Converts complex number to string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts. 35 Converts the value of the current complex number to its equivalent string representation in Cartesian form. 36 Returns a new Complex instance with a real number equal to zero and an imaginary number equal to zero.