-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunc.c
More file actions
38 lines (33 loc) · 715 Bytes
/
func.c
File metadata and controls
38 lines (33 loc) · 715 Bytes
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
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdlib.h>
#include "math.h"
// int add(int a, int b); // you have to declare your function before main to be able to call
// int sub(int a, int b);
// int divi(int a, int b);
// int mul(int a, int b);
int main(void){
int a ,b ;
printf("enter two numbere :");
scanf("%d%d",&a,&b);
char c;
getchar();
c =getchar();
switch (c)
{
case '+':
printf("sum is %d",add(a,b));
break;
case '-':
printf("sub is %d",sub(a,b));
break;
case '/':
printf("div is %d",divi(a,b));
break;
case '*':
printf("prod is %d",mul(a,b));
break;
default:
break;
}
return 0;
}