Add the two complex no.s given by user - c++ program, C/C++ Programming


 THIS PROGRAM IS TO ADD THE TWO COMPLEX NO.S GIVEN BY THE USER

 */

#include
#include
#include
struct complex
    {
    int real;
    int imag;
    };

void main()
 {
 clrscr();
 complex a,b,c;
 cout<<"input the real part for first complex number : ";
 cin>>a.real;
 cout<<"input the imaginary part for first complex number : ";
 cin>>a.imag;
 cout< cout<<"input the real part for second complex number : ";
 cin>>b.real;
 cout<<"input the imaginary part for second complex number : ";
 cin>>b.imag;
 c.real = a.real + b.real;
 c.imag = a.imag + b.imag;
 cout< cout<<"the sum is : "< getch();
 }

Posted Date: 10/22/2012 4:37:05 AM | Location : United States







Related Discussions:- Add the two complex no.s given by user - c++ program, Assignment Help, Ask Question on Add the two complex no.s given by user - c++ program, Get Answer, Expert's Help, Add the two complex no.s given by user - c++ program Discussions

Write discussion on Add the two complex no.s given by user - c++ program
Your posts are moderated
Related Questions
Programming an odds betting website Project Description: We want someone to program a odds betting website, Require someone with experience and skills! Skills required are

Project Description: P2P media streaming browser (IE, Chrome, Firefox) plug-in needed that is compatible with Win Xp,7,8 that is Windows Firewall friendly Example like Swarm

for object, malloc allocates memory in heap however doesn't invoke object's constructor to initialize the object. new allocates memory & also invokes constructor to initialize the


Write a C program to compute the factorial of  5 i.e 1x2x3x4x5 etc #include stdio.h   void main()   {   char promt;      int factor;   factor = 1*2*3*4*5;   printf("The fac

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n)

#At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with the


P o i n t er s to Members: In C a pointer is created  to locate  the address of another variable  for faster access. Consider the following example. int x, *p; p =