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
Hello, I would like to know if you can help in C programs that work on android.

Define the Double Data Type of c Language? The double is used to define BIG floating point numbers and it reserves twice the storage for the number. When the accuracy provided

I need Profile and optimize a C++ library for speed Project Description: Optimize and profile an existing C++ library for speed. This library uses OpenMP and OpenCV and C+

Explain string constants in c language - Escape Sequences? Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the st


padovan string generation till 40

I have a mini project where I need to write a code .wonder if someone can help me.I already have the forms and webmaster page done just need to code portion

Here is a short program. It prints out the value of a variable "x". Ernie and Bert disagree about what will be printed: Ernie says, the value gets changed in "changeX" so it will p

find wether specific word is inside a pool of word and what is the direction e.g. north

How can I handle a constructor that fails?