-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathHRITVIK1.CPP
More file actions
44 lines (44 loc) · 765 Bytes
/
HRITVIK1.CPP
File metadata and controls
44 lines (44 loc) · 765 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
39
40
41
42
43
44
//Program to do mathematical operations.
#include<stdio.h>
int main()
{
int a,b,c,d;
printf("Enter 1st Value= ");
scanf("%d",&a);
printf("Enter 2nd Value= ");
scanf("%d",&b);
printf("\n\nPress 1 For Addition");
printf("\nPress 2 For Subtraction");
printf("\nPress 3 For Multiplacation");
printf("\nPress 4 For Division");
printf("\nPress 5 For Modulo Division");
printf("\n\nEnter Your Choise= ");
scanf("%d",&c);
switch (c)
{
case 1:
d=a+b;
printf("\nAddition Is= %d",d);
break;
case 2:
d=a-b;
printf("\nSubtraction Is= %d",d);
break;
case 3:
d=a*b;
printf("\nMultiplacation Is= %d",d);
break;
case 4:
d=a/b;
printf("\nDivision Is= %d",d);
break;
case 5:
d=a%b;
printf("\nModulo Division Is= %d",d);
break;
default:
printf("\nInvalid Entry");
break;
}
return 0;
}