#include<iostream.h>
#include<conio.h>
#include<graphics.h>
void add();
void sub();
void mul();
void div();
void mod();
void line();
void main(void)
{
textbackground(RED);
textcolor(BLACK);
clrscr();
int choice;
do{
clrscr();

cout<<"\n\n\t\t\t  Enter 1 to find the sum.";
cout<<"\n\n\t\t\t  Enter 2 to find the difference..";
cout<<"\n\n\t\t\t  Enter 3 to find the product.";
cout<<"\n\n\t\t\t  Enter 4 to find the quotient.";
cout<<"\n\n\t\t\t  Enter 5 to find the modulous.";
cout<<"\n\n\t\t\t  Enter 6 to quit."<<endl;

cout<<"\n\n\n      Enter the choice : ";cin>>choice;
	switch(choice)
	{
	case 1 : add();
			 break;
   case 2 :  sub();
			 break;
   case 3 :  mul();
			 break;
   case 4 :  div();
			 break;
   case 5 :  mod();
			 break;
   default: cout<<"\n\t\t\t";
		cout<<"Try again."<<endl;
   }

}while(choice!=6);
getch();
}
void add()
{
clrscr();
int x,y,result;
cout<<"\n\n  Enter the 1st integer : ";cin>>x;
cout<<"\n\n  Enter the 2nd integer : ";cin>>y;
result=x+y;
cout<<"\n\n\t\tThe sum : "<<result<<endl;
cout<<"\n\n\n\n\t\t\tPress any key to continue.";
getch();
}
void sub()
{
clrscr();
int x,y,result;
cout<<"\n\n  Enter the 1st integer : ";cin>>x;
cout<<"\n\n  Enter the 2nd integer : ";cin>>y;
if(x>y)
result=x-y;
else
result=y-x;
cout<<"\n\n\t\tThe difference : "<<result;
cout<<"\n\n\n\n\t\t\tPress any key to continue.";
getch();
}
void mul()
{
clrscr();
int x,y,result;
cout<<"\n\n  Enter the 1st integer : ";cin>>x;
cout<<"\n\n  Enter the 2nd integer ";cin>>y;
result=x*y;
cout<<"\n\n\t\tThe product : "<<result;
cout<<"\n\n\n\n\t\t\tPress any key to continue.";
getch();
}
void div()
{
clrscr();
int x,y;
float result;
cout<<"\n\n  Enter the 1st integer : ";cin>>x;
cout<<"\n\n  Enter the 2nd integer ";cin>>y;
if(x>y)
result=(float) x / y ;
else
result=(float) y / x ;
cout<<"\n\n\t\tThe quotient : "<<result;
cout<<"\n\n\n\n\t\t\tPress any key to continue.";
getch();
}
void mod()
{
clrscr();
int x,y,result;
cout<<"\n\n  Enter the 1st integer : ";cin>>x;
cout<<"\n\n  Enter the 2nd integer ";cin>>y;
result=x%y;
cout<<"\n\n\t\tThe remainder : "<<result;
cout<<"\n\n\n\n\t\t\tPress any key to continue.";
getch();
}
void line()
{
int driver,mode;
int x1=190,y1=10;
int x2=450,y2=400;
int xc=325,yc=200;
int radius=150;
driver=DETECT;
initgraph(&driver,&mode,"c:\\borlandc\\bgi");
//line(x1,y1,x2,y2);
circle(xc,yc,radius);
getch();
closegraph();
}