0% found this document useful (0 votes)
1 views2 pages

Include

Uploaded by

riadhuri26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Include

Uploaded by

riadhuri26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#include<iostream.

h>

#include<<conio.h>

class complex

private : float x,y;

public : complex () {};

complex(float real,float imag)

x= real;

y= imag;

complex operator + (complex c );

void show()

cout<<x<<"+I"<<y<<end1;

complex complex: :operator + (complex c)

complex temp;

temp.x= x +c.x;

temp.y= y +c.y;

return temp;

int main()

clrscr();

complex c1(2.3,3.4) , c2(4.4,3.5) , c3;

cout<<."c1=";

[Link]();

cout<<"c2=";

[Link]();
c3= c1 + c2;

cout<<"Addition = ";

[Link]();

return 0;

c1=2.3+i3.4

c2=4.4+i3.5

Addition = 6.7+i6.9

You might also like