#include <stdio.h> #include <stdlib.h> #include <string.h> #define sg struct gammal struct gammal{ -char name[20]; -int payment; -struct gammal *next; }; sg* add (sg *g){ -if(g == NULL){ --g = (sg*)malloc(sizeof(sg)); --printf("Enter the name: "); --scanf("%s",g->name); --printf("Enter payment: "); --scanf("%d",&g->payment); --g->next = NULL; --return g; -} -g->next = add(g->next); -return g; } void show (sg *g){ -while(g != NULL){ --printf("------ "); --printf("%s ",g->name); --printf("%d ",g->payment); --g = g->next; -} -printf("------ "); } int main() { -sg *head=NULL; -head = add(head); -head = add(head); -show(head); }