write a program in c to add, subtract, multiply and divide two complex numbers?

z1 = a1+jb2

z2 = a2 +jb2

express the result in angular form?

xxxxxxxxxxxxxxxxxxxx

This is a discussion on *OR THis 1* within the **C Programming** forums, part of the General Programming Boards category; write a program in c to add, subtract, multiply and divide two complex numbers?
z1 = a1+jb2
z2 = a2 ...

- 01-15-2002 #1

- Join Date
- Jan 2002
- Posts
- 5

## OR THis 1

write a program in c to add, subtract, multiply and divide two complex numbers?

z1 = a1+jb2

z2 = a2 +jb2

express the result in angular form?

xxxxxxxxxxxxxxxxxxxx

- 01-15-2002 #2
This sounds a lot like a homework problem (whether it originated from your "boyfriend" or your instructor). Please post the code you have to solve this problem so we can see what you understand and what you are missing.

Thanks.**Jason Deckard**

- 01-15-2002 #3

- Join Date
- Jan 2002
- Posts
- 5

## ????????????????

i dont understand c at all!!

that was the question 4my assignment???

its in tomoz and im stuck?

pls help me

- 01-15-2002 #4

- Join Date
- Aug 2001
- Location
- Groningen (NL)
- Posts
- 2,386

>i dont understand c at all!!

I guess then you don't know about structures. But it isn't too hard. A structure is a set of data. A structure can be defined this way:

Code:struct complex_number { int real; int imaginary; };

Code:struct complex_number complex;

Code:complex.real = 2; complex.imaginary = 3;

Assume:

z = a + j b

p = m + jn

then

w = z + p =( a + m) + j (b + n)

This can be implemented as:

Code:struct complex_number z, p, w; z.real = 2; z.imaginary = 4; p.real = 3; p.imaginary = 6; w.real = z.real + p.real; w.imaginary = z.imaginary + p.imaginary;

- 01-15-2002 #5
I've got the answer for this in Java - I'll post it when I get home from work and can FTP into the school.

-Govtcheez

govtcheez03@hotmail.com

- Exactly how to get started with C++ (or C) today
- C Tutorial
- C++ Tutorial
- 5 ways you can learn to program faster
- The 5 Most Common Problems New Programmers Face
- How to set up a compiler
- 8 Common programming Mistakes
- What is C++11?
- Creating a game, from start to finish

- How to create a shared library on Linux with GCC - December 30, 2011
- Enum classes and nullptr in C++11 - November 27, 2011
- Learn about The Hash Table - November 20, 2011
- Rvalue References and Move Semantics in C++11 - November 13, 2011
- C and C++ for Java Programmers - November 5, 2011
- A Gentle Introduction to C++ IO Streams - October 10, 2011