Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  calculator
Language: C/C++
Code:
#include <stdio.h>
#include<conio.h>
int main()
{
int operation,a,b,result;     
printf("enter your operation +,-,*,/ \n");
scanf("%d",&operation);
printf("Enter first number \n");
scanf("%d",&a);
printf("Enter second number \n");
scanf("%d",&b);
switch(operation){
case '+':result=a+b;
printf("%d",result);
break;

case '-':result=a-b;
printf("%d",result);
break;

case '*':result=a*b;
printf("%d",result);
break;

case '/':result=a/b;
printf("%d",result);
break;

default :printf("wrong choice");
break;
}


getch();
}
          
          
          
          
          
          
          
          
          
Comments: