Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  m
Language: C/C++
Code:
#include<stdio.h>
#include<conio.h>
int main()
{
int a,b;
float c;

char oper;

printf("\n enter first number");scanf("%d",&a);

printf("\n enter + - * or / ");scanf("%c",&oper);

printf("\n enter second number");scanf("%d",&b);

switch(oper)
{
     case '+':c = a+b;
     break;
     case '-':c = a-b;
     break;
     case'/':c = a/b;
     break;
     case '*':c = a*b;
     break;
     default:printf("n invalid operation entered");
}
printf("n answer is %f ",c);
getch();
}
          
     
     
     
     
     
     
     
     
     
     
     
     
     
     
































     

          
          
          
Comments: