//max=Maximum size of Stack
//initially, top= -1
void push()
{
int item;
if(top==(max-1))
printf("\n Stack is full \n");
else
{
printf("\n enter the item \n");
scanf("%d",&item);
top=top+1;
stack[top]=item;
printf("\n the pushed item is %d",stack[top]);
}
}
0 comments:
Post a Comment