Rohini Pract 1.cpp
Rohini Pract 1.cpp
{
complex c1,c2,c3,c4;
int ch;
char choice;
do
{
cout<<"\n 1. read complex numbers\n 2. Add two complex numbers \n 3.Multiply
two complex number";
cout<<"\n enter your choice ";
cin>>ch;
switch(ch)
{
case 1: c1.read();
c2.read();
break;
case 2:
c3=c1+c2;
c1.display();
c2.display();
cout<<"\n Addition";
c3.display();
break;
case 3:c4=c1*c2;
c1.display();
c2.display();
cout<<"\n Multiplication";
c4.display();
default:cout<<"\n Invalid choice";
}
cout<<"\n Do you want to continue(y/n)";
cin>>choice;
}while(choice=='y');
return 0;
}