Stack 1
Stack 1
Stack 1
h>
#include <stdlib.h>
// Maximum size of stack is 5(that i have taken)
#define max 5
printf("\n");
return;
}
int main()
{
int item, ch;
// This is a menu driven Program
while (1)
{
printf("1. PUSH\n2.POP\n3.Show\n4.Quit\n");
printf("Enter your choice(1,2,3 or 4) ... ");
scanf("%d", &ch);
switch (ch)
{
case 1:
printf("Enter an item to be pushed ");
scanf("%d", &item);
push(item);
break;
case 2:
pop();
break;
case 3:
show();
break;
case 4:
exit(0);
break;
default:
printf("Invalid Input");
break;
}
}
return 0;
}