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

Assignment Help:


 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();
 }


Related Discussions:- Add the two complex no.s given by user - c++ program

Define array of structures, Define Array of Structures? An Array of Str...

Define Array of Structures? An Array of Structures is an assortment of the same data types which are declared as structures. It is useful to store large and different number of

File IO, I''m trying to write a function that prints the substring if it is...

I''m trying to write a function that prints the substring if it is found in the string, and after it prints it deletes it from the string so i could print the next substring if it

Open and close ?les for writing, If you have computed a number (stored as a...

If you have computed a number (stored as a ?oating-point value) and want to display this on a plot (i.e. as a character string) you have to convert it into a STRING. That is we wan

C program to read the contents of a file, Program is to read the contents o...

Program is to read the contents of a file: void main()    {   ifstream fin("ascii.txt");   char ch;   while(! fin.eof())     {   fin>>ch;   cout     }

Algorithm, algorithm to prepare mark sheet of a student by inputing name,br...

algorithm to prepare mark sheet of a student by inputing name,branchcode,semester,register no,5 marks of students and total mark of student

Develop a c program for linux, develop a C program for Linux called pipes.c...

develop a C program for Linux called pipes.c that does the following: In the main() function, it creates a pipe using the pipe() function, then creates two child processes with

Explain the array types, Array types An array is a collection of object...

Array types An array is a collection of objects of a one data type. The individual objects are accessed by their position in the array. This way of accessing is known as indexi

Experiment with the small test matrix, For this assignment, I've provided a...

For this assignment, I've provided a data file called 'elevation.mat', which contains the elevation data you'll be working with.   Type load elevation.mat to get the varia

Decode the code, smugglers are becoming very smart day by day. Now they hav...

smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd