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
Q: How can one encourage his (older) compiler to check new to see automatically if it returns NULL?       A: His compiler eventually will. If he contain an old compiler wh

Create a user-defined data structure (struct) called Node that represents a node within a linked list where the "data" stored in each node is a pointer to a Car object.    a) Wr

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

# include stdio.h> # include string.h> # include conio.h> void main()   {           int i=0,count=0;           char a[100],b;           clrscr();

Define the Increment and Decrement Operators in c language? C offers two special operators -and ++ called decrement and increment operators respectively and these are unary ope

Suppose we use Lists to represent a movie which has a title, cast and year. For example, the following list represents the movie, "Die Hardly", with the cast "Bruce Willing" and "T

construct a console programme for a bank ATM machine.

Draw a picture using line: void main(void) {     int   driver = DETECT,mode;     int   x[10],y[10];     int   x_center = 360, y_center = 180, rad = 100;     int

Receive 3 numbers and display them in ascending order from smallest to largest ed#

What if one forget the [] when deleteing array allocated through new T[n]? A: All life comes to a disastrous end. It is the programmer's responsibility not the compiler's to