Define a complex number in c program, C/C++ Programming

Define a complex number in c program:

class complex




                                int real,ima;


                                public :

                                void input();

                                friend complex sum(complex,complex);

                                void show();



 void complex:: show(void)


                 cout << "real part ="<< real << "\nThe imaginary part ="<



 void  complex ::input()


                cout<<"enter the real and imaginary part\n";

                cin >> real >> ima;



complex sum( complex a,complex b)


                complex c;

                c.real= a.real + b.real;

                c.ima= a.ima + b.ima;

                return c;



void main()


                complex a,b,c;








Posted Date: 10/18/2012 6:36:53 AM | Location : United States

Related Discussions:- Define a complex number in c program, Assignment Help, Ask Question on Define a complex number in c program, Get Answer, Expert's Help, Define a complex number in c program Discussions

Write discussion on Define a complex number in c program
Your posts are moderated
Related Questions
draw the flow chart to print the fibonacci series upto n th terms

Program for Swapping the Two Integers                 For example, Swapping the two value                                 int x=4,y=6,t;                                 t

how to avoid duplicates strings in an array

Pointers are just numbers, representing addresses in memory. You can add to and subtract from pointers, for instance. It is pretty easy to make mistakes with pointer math, however,

Example for external storage class - computer programming? extern double sin (double); In a function prototype, for the sin() function its function definition ~ we can write

find area uder the curve y=f(x) between x=a and x=b

Define Some Features of Automatic Variables in C program? The features of automatic variables are like as Storage - memory Default initial value - an unpredictable value,

3. Write a program to encrypt and decrypt strings of characters using the following ciphers: a) Caesar cipher b) Vigenere cipher c) Matrix transposition cipher Your program shoul

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Write a program that finds the minimum total number of shelves, including the initial one required for this loading process