Professional Documents
Culture Documents
h>
#include <stdlib.h>
struct Stack
{
int size;
int top;
int *S;
};
int main()
{
int choice;
char ch;
struct Stack st;
create(&st);
Display(st);
do
{
printf("\nEnter 1 to push \nEnter 2 to pop \nEnter 3 to peep\n");
scanf("%d",&choice);
switch(choice)
{
case 1: push(&st);
Display(st);
break;
case 2: pop(&st);
Display(st);
break;
case 3: peek(&st);
break;
default: printf("Invalid Choice\n");
}
printf("Enter y/n to continue: ");
scanf(" %c",&ch);
}
while(ch=='y');
return 0;
}