//I am always ensuring that list is not empty so I didnt write that code yet
//when I was unable to do it I copied from someother sites but it still not working
//Its going in a infinite loop
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
typedef struct node {
int info;
struct node *link;
}NODE;
NODE *START = NULL;
NODE* create_node(){
NODE *n;
n=(NODE*)malloc(sizeof(NODE));
return n;
}
int delete_last_node() {
NODE *end_node, *t;
end_node = START;
while (end_node->link != NULL)
{
t=end_node;
end_node=end_node->link;
}
//t = end_node;
printf("Number deleted is: %d", end_node->info);
free(t);
return 0;
}```