Академический Документы
Профессиональный Документы
Культура Документы
void main()
{
clrscr();
complex obj1,obj2,result,result1;
cout<<"\nBinary operator overloading without friend function";
cout<<"\n***************************************************\n";
cout<<"Enter the value of first complex number\n";
obj1.getvalue();
cout<<"Enter the value of second complex number\n";
obj2.getvalue();
result=obj1+obj2;
result1=obj1-obj2;
cout<<"\nGiven values:";
cout<<"\n************\n";
obj1.display();
obj2.display();
cout<<"\nResult:";
cout<<"\n******\n";
cout<<"Addition of two complex numbers:\n";
cout<<"*******************************\n";
result.display();
cout<<"subtraction of two complex numbers:\n";
cout<<"**********************************\n";
result1.display();
getch();
}