#include <iostream.h>
#include <conio.h>
int main ()
{
clrscr();
float fn,sn; //declaration for users input.
float x; //declaration for answer.
float c,a=1,s=2,m=3,d=4; //declaration "c" for user input and others are for +,-,*,/.
cout <<"WELLCOM TO CALCULATOR IN C++" <<endl;
cout <<"Enter First Number : ";
cin >> fn; //first number
cout <<"\n Enter Opration Sign That You Want To Perform According To Menu" <<endl;
cout <<" MENU \n 1 Is For Addition \n 2 Is For Subtraction \n 3 Is For Multiplacation \n 4 Is For Division " <<endl; //menu
cout <<" OPRATION SIGN = ";
cin >> c;
cout <<"\nEnter Your Scond Number : ";
cin >> sn; //scond number
cout <<endl;
if (c==a)
{
x=fn+sn;
cout <<" The Sum Is = "<< x <<endl;
}
else if (c==s)
{
x=fn-sn;
cout <<"The Difference Is = "<< x <<endl;
}
else if (c==m)
{
x=fn*sn;
cout <<" The Multiplacation Is = "<< x <<endl;
}
else if (c==d)
{
x=fn/sn;
cout <<"The Division Is = "<< x <<endl;
}
getch();
return 0;
}
#include <conio.h>
int main ()
{
clrscr();
float fn,sn; //declaration for users input.
float x; //declaration for answer.
float c,a=1,s=2,m=3,d=4; //declaration "c" for user input and others are for +,-,*,/.
cout <<"WELLCOM TO CALCULATOR IN C++" <<endl;
cout <<"Enter First Number : ";
cin >> fn; //first number
cout <<"\n Enter Opration Sign That You Want To Perform According To Menu" <<endl;
cout <<" MENU \n 1 Is For Addition \n 2 Is For Subtraction \n 3 Is For Multiplacation \n 4 Is For Division " <<endl; //menu
cout <<" OPRATION SIGN = ";
cin >> c;
cout <<"\nEnter Your Scond Number : ";
cin >> sn; //scond number
cout <<endl;
if (c==a)
{
x=fn+sn;
cout <<" The Sum Is = "<< x <<endl;
}
else if (c==s)
{
x=fn-sn;
cout <<"The Difference Is = "<< x <<endl;
}
else if (c==m)
{
x=fn*sn;
cout <<" The Multiplacation Is = "<< x <<endl;
}
else if (c==d)
{
x=fn/sn;
cout <<"The Division Is = "<< x <<endl;
}
getch();
return 0;
}