Q1
Q1
h>
#include <stdlib.h>
int isFull() {
if (top == MAX - 1)
return 0;
int isEmpty() {
if (top == -1)
return 0;
if (isFull()) {
} else {top=top+1;
int pop() {
if (isEmpty()) {
} else {
top=top-1;
return poppedValue;
int peek() {
if (isEmpty()) {
return -1;
} else {
void display() {
if (isEmpty()) {
printf("Stack is empty!\n");
} else {
printf("\n");
}
int main() {
push(10);
push(20);
push(30);
push(40);
push(50);
display();
pop();
pop();
display();
if (topElement != -1) {
return 0;