Saturday, 18 December 2010

Flow chart for To read the two complex numbers and perform the addition and multiplication of these two numbers

In this program the complex number means it contains the two parts . first one

is real part and second one is imaginary part(2+3i).by taking these two complex numbers we can perform the addition and multiplication operation.


Output:

***** MAIN MENU *****

Select your option: 
1 : ADD
2 : MULTIPLY
0 : EXIT

Enter your Option [ 1]

Enter two Complex Numbers (x+iy):
Real Part of First Number:2
Imaginary Part of First Number:2

Real Part of Second Number:2
Imaginary Part of Second Number:2

Answer = 4.000000+4.000000i
***** MAIN MENU *****
Select your option: 
1 : ADD
2 : MULTIPLY
0 : EXIT

Enter your Option [ 2]

Enter two Complex Numbers (x+iy):
Real Part of First Number:2
Imaginary Part of First Number:2

Real Part of Second Number:2
Imaginary Part of Second Number:2

Answer = 0.000000+8.000000i

***** MAIN MENU *****

Select your option: 
1 : ADD
2 : MULTIPLY
0 : EXIT

Enter your Option  3 
invalid option

***** MAIN MENU *****

Select your option:
 1 : ADD
2 : MULTIPLY
0 : EXIT

Enter your Option [ 0]

Conclusion: The program is error free

VIVA QUESTIONS:

1) Define structure ?
Ans: Structure is amethod for packing data of different types. Structure help to organize complex data in a more meaninigful way.

2) What is use of <math.h> header file ?
Ans: It is used to access the mathematical functions in programs.





program

No comments:

Post a Comment