-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain34.c
44 lines (43 loc) · 1.17 KB
/
main34.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <stdio.h>
#include <stdlib.h>
int main() {
int a , b, ch;
printf("\n\bMain Menu");
printf("\n1.Add\n2.Sub\n3.Multi\n4.Division\n5.Exit\n Type > ");
scanf("%d",&ch);
switch (ch){
case 1:
printf("\nFirst number > ");
scanf("%d",&a);
printf("Second Number > ");
scanf("%d",&b);
printf("Sum = %d",a+b);
break;
case 2:
printf("\nFirst number > ");
scanf("%d",&a);
printf("Second Number > ");
scanf("%d",&b);
printf("Sub = %d",a-b);
break;
case 3:
printf("\nFirst number > ");
scanf("%d",&a);
printf("Second Number > ");
scanf("%d",&b);
printf("Multi = %d",a*b);
break;
case 4:
printf("\nFirst number > ");
scanf("%d",&a);
printf("Second Number > ");
scanf("%d",&b);
printf("Division = %d",a%b);
break;
case 5:
exit;
default:
printf("Invalid Input");
}
return 0;
}