Posts

Showing posts from February, 2025

ds lab

  1. Write a C Program to construct a stack of integers and to perform the following operations on it:         a. Push b.   Pop c.    Display   The program should print appropriate messages for stack overflow, stack underflow and stack          empty.     #include<stdio.h> #include<conio.h> #include<process.h> #define MAX_SIZE 4   int s[MAX_SIZE],top=-1;   void main() { void PUSH(int); void POP(); void DISPLAY(); int ch,x;   while(1)   {   clrscr();   printf("\n enter your choice \n\n 1.PUSH \n 2.POP \n 3.DISPLAY \n 4.EXIT \n\n");   scanf("%d",&ch);   switch(ch)   {             case 1: printf("\n enter the element to be inserted \n");                   ...