Write
a program of array implementation of a stack
#include<stdio.h>
#include<conio.h>
void push(int);
int pop();
int stack[10];
int top=-1,a;
void push(int num)
{
if (top>=10)
{
printf("stack is
full");
return;
}else{
top++;
stack[top]= num;
return;
}}
int pop()
{
Int num;
if (top<0)
{
printf("stack is
empty");
return -1;
}
else{
num=stack[top];
top--;
return num;
}}
void main()
{
scanf("%d",&a);
push(a);
printf("The value of
pop is:%d",pop());}
Output