Here is a stack program. It seems to be the topic of the day. This is the stack program that I wrote this morning.Code:#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> struct stack { int sdata; struct stack *next; } ; struct stack *Push (struct stack *llist, int data); struct stack Pop (struct stack ** llist); void ReleaseStack(struct stack * llist); int main () { struct stack *llist = NULL; int data, choice; do { printf("\nEnter choice (1: Push) (2: Pop) (3: end) : "); scanf("%d",&choice); while(getchar() != '\n') continue; switch (choice) { case 1: printf ("Integer to Push onto the stack: "); scanf ("%d", &data); //clear memory buffer while(getchar() != '\n') continue; llist = Push(llist,data); break; case 2: if (llist == NULL) { printf ("stack empty!\n"); }else { struct stack temp = Pop(&llist); printf("%d Popped.\n", temp.sdata); } case 3: break; default: printf ("Invalid menu choice - try again\n"); break; } } while (choice != 3); ReleaseStack(llist); return 0; } struct stack * Push(struct stack * llist, int data) { struct stack *newp = NULL; if(llist == NULL) { newp = (struct stack *) malloc (sizeof (struct stack)); newp->next = NULL; newp->sdata = data; llist = newp; return llist; }else { newp = (struct stack *) malloc (sizeof (struct stack)); newp->sdata = data; newp->next = llist; return newp; } } struct stack Pop (struct stack ** llist) { //holds the return value (data) struct stack temp; //use to free the head node struct stack *freep = *llist; //reposition the head of the stack for post Pop if((*llist)->next == NULL) { *llist = NULL; temp = *freep; free(freep); }else { *llist = (*llist)->next; //get data value temp = *freep; //free head node free(freep); } return temp; } void ReleaseStack(struct stack * llist) { while(llist != NULL) { printf("releasing %d\n", Pop(&llist)); } }