#include<stdio.h>
int sarr[7];
int i,j=200;top=-1;
int push();
int pop();
int display();
int ch;
int main()
{
while(j>1)
{
printf(“enter case\n”);
scanf(“%d”,&ch);
switch(ch)
{
case 0:push();
break;
case 1:pop();
break;
case 3:j=-1;
break;
default:
printf(“wrong selection”);
}
}
}
int push()
{
if(top>7)
{
printf(“overflow”);
}
else
{
printf(“enter value”);
top++;
scanf(“%d”,&sarr[top]);
display();
}
int pop()
{
if(top<0)
{
printf(“underflow\n”);
}
else
{
top–;
display();
}
}
int display()
{
int i;
for(i=top;i>0;i–)
{
printf(“values are%d”,sarr[i]);
}
}
}
What type of Error you are getting from this code in your Output ??
its not working properly…may be there is a problem wid logic…i’ll see that