answersLogoWhite

0


Best Answer

Store your complex numbers in a structure of some sort that has two variables - one to store the real part and one to store the complex part.

Then to add two complex numbers, add the real parts together and add the complex part together, eg:

(2 + 3i) + (5 - 2i) = ((2 + 5) + (3 + -2)i)

= (7 + i)

how you actually do this will be entirely up to the language you are using for your programming.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a programme to add two complex numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic
Related questions

Write a c programme to add all numbers between 100 and 200 which contain the digit 5?

int doSomebodysClassHomeworkForThem( ) { // Add all the numbers between 100 and 200 with a digit 5 in it return (105+115+125+135+145+150+155+165+175+185+195); }


How to solve imaginary complex numbers?

That depends a lot on what you want to solve. In general, you can do quite a lot by simply considering the complex number like any polynomial, and remembering that i2 = -1. For example, to add two complex numbers, you simply add the real and the imaginary part of both numbers.


How do you solve complex numbers?

That depends what is the problem given, and what you want to solve. You may want to read an introductory article on complex numbers, to learn how you add them, multiply them, etc.That depends what is the problem given, and what you want to solve. You may want to read an introductory article on complex numbers, to learn how you add them, multiply them, etc.That depends what is the problem given, and what you want to solve. You may want to read an introductory article on complex numbers, to learn how you add them, multiply them, etc.That depends what is the problem given, and what you want to solve. You may want to read an introductory article on complex numbers, to learn how you add them, multiply them, etc.


What are the similarities between vectors and complex numbers?

If you add two complex numbers, the resulting complex number is equivalent to the vector resulting from adding the two vectors. If you multiply two complex numbers, the resulting complex number is equivalent to the vector resulting from the cross product of the two vectors.


How do you write formulas for complex ions?

To write formulas for complex ions, start by writing the symbol of the central metal cation. Then, add the ligands around the central metal cation. Use coordination numbers and oxidation states to balance the charges of the ions within the complex. Finally, enclose the entire complex in square brackets and indicate the charge outside the bracket.


What are the numbers when you add you get -3 when multiplied you get 40?

There are no two real numbers that do. Using complex numbers, these two do: (-3/2 + i√151/2) & (-3/2 - i√151/2) Two numbers that add to -3 and multiply to -40 are -8 & 5 Two numbers that add to 3 and multiply to -40 are 8 & -5 Two complex numbers that add to 3 and multiply to 40 are (3/2 + i√151/2) & (3/2 - i√151/2)


Write a program to add two 8 bit numbers in microprocessor 8051?

write it in 8085


Hoe can you write a programme to claculate 1 plus 2 plus 3..100?

You add the numbers in a loop. Here is an example in Java:int sum = 0;for (int i = 1; i


How do you add complex numbers videos?

See the related link (below) for a video that may help.


What two numbers will multiply to 5 and add to 4?

There are no two real numbers that do, but the complex numbers (2 + i) and (2 - i) will.If you want two numbers that multiply to negative 5 and add to positive 4 then: -1 and 5If you want two numbers that multiply to negative 5 and add to negative 4 then: 1 and -5


What two numbers multiply together to equal 2 and add to be -2?

0


How do you write a program in java to read ten numbers and print sum of ten integers?

Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.