#include <stdio.h>
int main()
{
char operator;
int a,b,c;
scanf("%c",&operator);
scanf("%d",&a);
scanf("%d",&b);
printf("The two given integers are:\n%d\n%d\n",a,b);
switch(operator)
{
case '+':
c=a+b;
printf("The sum of the integers is: %d\n",c);
break;
case '-':
c=a-b;
printf("The difference of the two numbers is: %d\n",c);
break;
case '*':
c=a*b;
printf("The product of the two integers is: %d\n",c);
break;
case '%':
c=a%b;
printf("The division of the two integers is:%d\n",c);
break;
default:
printf("Enter valid operator\n");
break;
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: