-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.c
More file actions
34 lines (33 loc) · 700 Bytes
/
Copy pathstack.c
File metadata and controls
34 lines (33 loc) · 700 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
//stack operstions
#include<stdio.h>
#include"stackop.c"
int main()
{
int choice ,value;
printf("\n***STACK OPERATIONS***\n");
while( choice != 4)
{
printf("\n1.push\n2.pop \n3.display\n4.exit");
printf("\n enter your choice");
scanf("%d",&choice);
switch(choice)
{
case 1:
printf("\n\nenter the number :");
scanf("%d",&value);
push(value);
break;
case 2:
printf("\n\npopped item is %d",pop());
break;
case 3:
display();
break;
case 4:
exit(0);
break;
default:
printf("invalid choice");
}
}
}