#include<stdio.h>
#include<conio.h>
int cal(int,char,int);
int main()
{
int n1, n2;
char sign;
printf("enter 1st value & 2nd value\n");
printf("and press enter\n");
scanf("%d %d", &n1, &n2);
printf("entetr operator +, -, x, /, %\n");
sign = getch();
cal(n1, sign, n2);
getch();
}
int cal(int x,char aop, int y)
{
switch(aop)
{
case '+':
return printf(" the sum is %d\n",x+y);
break;
case '-':
return printf(" the subtract is %d\n",x-y);
break;
case '*':
return printf("the muliply is %d\n",x*y);
break;
case '/':
return printf("the division is %d\n",x/y);
break;
case '%':
return printf("the reamainder is %d\n",x%y);
break;
default:
return printf("invalid input");
}}
#include<conio.h>
int cal(int,char,int);
int main()
{
int n1, n2;
char sign;
printf("enter 1st value & 2nd value\n");
printf("and press enter\n");
scanf("%d %d", &n1, &n2);
printf("entetr operator +, -, x, /, %\n");
sign = getch();
cal(n1, sign, n2);
getch();
}
int cal(int x,char aop, int y)
{
switch(aop)
{
case '+':
return printf(" the sum is %d\n",x+y);
break;
case '-':
return printf(" the subtract is %d\n",x-y);
break;
case '*':
return printf("the muliply is %d\n",x*y);
break;
case '/':
return printf("the division is %d\n",x/y);
break;
case '%':
return printf("the reamainder is %d\n",x%y);
break;
default:
return printf("invalid input");
}}