Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  sample
Language: C/C++
Code:
#include<iostream.h>
#include <stdio.h>
#include<conio.h>
int main ()
{

clrscr();
char OP;
double num1,num2;
cout<<"\n[A]-Addition";
cout<<"\n[S]-Subtraction";
cout<<"\n[M]-Multiplication";
cout<<"\n[D]-Division";
cout<<"\n Enter Operation:";
cin>>OP;
cout<<"\n Enter Number 1:";
cin>>num1;
cout<<"\n Enter Number 2:";
cin>>num2;
A=num1+num2;
S=num1-num2;
M=num1*num2;
D=num1/2;
if(OP==A)
cout<<"\n The sum is:"<<A;
else if(OP==S)
cout<<"\n The difference is:"<<S;
else if (OP==M)
cout<<"\n The product is:"<<M;
else if (OP==D)
cout<<"\n The quotient is :"<<D;
else
cout<<"\n Invalid Operation";
getch();
return 0;
}
          
Comments: