PUSH Program in Data Structure

No comments

PUSH:

#define N 10 // Maximum elements in a stack
int top = -1 // indicates empty stack
int s[N] // initially all the element are (-1)
void PUSH()
{
if (top == N)
{
printf("Stack is Full");
exit (0);
}
top = top+1;
printf("Enter any number");
scanf("%d",&item);
s[top] = item;

}

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀