-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path4.c
More file actions
30 lines (29 loc) · 760 Bytes
/
4.c
File metadata and controls
30 lines (29 loc) · 760 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
#include<stdio.h>
void main()
{
float a,b;
int op;
printf(" 1.Addition\n 2.Subtraction\n 3.Multiplication\n 4.Division\n");
printf("Enter the values of a & b: ");
scanf("%f %f",&a,&b);
printf("Enter your Choice : ");
scanf("%d",&op);
switch(op)
{
case 1 :
printf("Sum of %.2f and %.2f is : %.2f",a,b,a+b);
break;
case 2 :
printf("Difference of %.2f and %.2f is : %.2f",a,b,a-b);
break;
case 3 :
printf("Multiplication of %.2f and %.2f is : %.2f",a,b,a*b);
break;
case 4 :
printf("Division of Two Numbers is %.2f : ",a/b);
break;
default :
printf(" Enter Your Correct Choice.");
break;
}
}