Calculator in c + +
using namespace std;
#include<iostream>
#include<conio.h>
int main()
{
int op1,op2,op3,op4,x,y,sum,sub,mul,div;
cout<<"\n Enter 1 for airtmatic operator";
cout<<"\n Enter 2 for relational operator";
cout<<"\n Enter ";
cout<<"\n Enter your choice:";
cin>>op1;
switch(op1)
{
case 1:
cout<<"\n Enter 11 for addition :";
cout<<"\n Enter 12 for substraction :";
cout<<"\n Enter 13 for multiplicatio :";
cout<<"\n Enter 14 for division :";
cout<<"\n Enter your choice:";
cin>>op1;
switch(op2)
{
case 11:
cout<<"\n Enter the value of x:";
cin>>x;
cout<<"\n Enter the value of y:";
cin>>y;
sum==x+y;
cout<<"\n sum="<<sum;
break;
}
break;
}
}
#include<iostream>
#include<conio.h>
int main()
{
int op1,op2,op3,op4,x,y,sum,sub,mul,div;
cout<<"\n Enter 1 for airtmatic operator";
cout<<"\n Enter 2 for relational operator";
cout<<"\n Enter ";
cout<<"\n Enter your choice:";
cin>>op1;
switch(op1)
{
case 1:
cout<<"\n Enter 11 for addition :";
cout<<"\n Enter 12 for substraction :";
cout<<"\n Enter 13 for multiplicatio :";
cout<<"\n Enter 14 for division :";
cout<<"\n Enter your choice:";
cin>>op1;
switch(op2)
{
case 11:
cout<<"\n Enter the value of x:";
cin>>x;
cout<<"\n Enter the value of y:";
cin>>y;
sum==x+y;
cout<<"\n sum="<<sum;
break;
}
break;
}
}
Comments
Post a Comment