-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathP8SWITCH.C
More file actions
50 lines (35 loc) · 761 Bytes
/
P8SWITCH.C
File metadata and controls
50 lines (35 loc) · 761 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
45
/*
Name: Hitesh Patel Roll No: 999
Title: WAP to check whether Year is Leap Year or Not.
*/
#include <stdio.h>
#include <conio.h>
void main()
{
int choice;
int n1,n2;
int sum, sub,mul;
float divide;
clrscr();
printf("WELCOME TO menu driven program of calculator \n");
printf("PLEASE SELECT ANY ONE CHOICE:\n");
printf("1. ADD:\n");
printf("2. SUB:\n");
printf("3. MUL:\n");
printf("4. DIV:\n");
printf("5. EXIT:\n");
scanf("%d",&choice);
printf("PLEASE ENTER NUMBER 1:\n");
scanf("%d",&n1);
printf("PLEASE ENTER NUMBER 2:\n");
scanf("%d",&n2);
// IMPLEMENT SWITCH CASE
switch(choice)
{
case 1:
sum = n1+n2;
printf("YOUR SUM IS = %d",sum);
break;
}
getch();
}