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
Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

What is the difference between early binding and late binding? What are advantages of early binding? a.) Late binding refers to function calls which aren't resolved until run t

Problem Statement: You have to write a C program to develop a Car Parking Management System for a busy commercial area. The system will record the car plate number, date and time w

How do you write the code for summations

Explain the class invariant. - It's a condition that ensures correct working of a class and defines all the valid states for an object. - When an object is created class inv

Returning References from Functions Just as in passing the parameters by reference, returning a reference also doesn't return back a copy of the variable , instead an alias is

palindrome program with minimum character replacements

C Program for FIND EVEN & ODD NO.S IN THE ARRAY #include stdio.h> #include string.h> #include conio.h> void main() {           int i=0,j=0, l_e[100],l_o[100];

What is copy constructor? describe the concept of copy constructor.

(a) Pairs may be represented using a lambda. Using only lambdas, create a procedure (triple x y z) that constructs a triplet. You may NOT use car, cons or cdr in the triplet proced