/*header file declare*/
#include<stdio.h>
#include<conio.h>
void main(){
/*Declare local variable*/
char ch;
int valuea;
int valueb;
int output;
/*user enter symbol*/
printf("Enter the symbol : ");
do{
scanf("%c",&ch);
/*wrong input , will notify the user*/
if(ch!='+' && ch!='*' && ch!='-' && ch!='/'){
printf("Invalid symbol , Please enter correct symbol \n");
}
}while(ch!='+' && ch!='*' && ch!='-' && ch!='/');
/*Enter first value*/
printf("\nEnter vallue A :");
scanf("%d",&valuea);
/*Enter second value*/
printf("\nEnter vallue B :");
scanf("%d",&valueb);
/*perform operation for output*/
if(ch=='+'){
output=valuea+valueb;
}
if(ch=='-'){
output=valuea-valueb;
}
if(ch=='*'){
output=valuea*valueb;
}
if(ch=='/'){
output=valuea/valueb;
}
/*print final answer */
printf("\n\n%d %c %d = %d",valuea,ch,valueb,output);
getch();
}