C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
int add (int , int );
int subtract (int , int );
int mult (int , int );
int divide (int , int );
int main ()
{
char x='+';int a,b,y=0;
printf ("Enter two no.(s) to operate\n");
scanf ("%d%d",&a,&b);
printf ("What function you want\nadd: +\nsubtract: -\nmultiply: *\ndivide: /\n");
scanf("%c",&x);
switch (x){
case '+':
y=add (a,b);break;
case '-':
y=subtract(a,b);break;
case '*':
y=mult (a,b);break;
case '/':
y=divide (a,b);break;
}
printf("Result= %d",y);
return 0;
}
int add (int first, int second){
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run