C Saved Program: fragrant-mountain

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include <stdio.h>
#include<stdlib.h>

typedef struct mylist
{
    int info;
    struct mylist *link;
}Node;

int main()
{
    //Creation of LL
    
    Node *a=(Node *)malloc(sizeof(Node));
    Node *b=(Node *)malloc(sizeof(Node));
    Node *c=(Node*)malloc(sizeof(Node));
    
    a -> link =NULL;
    b -> link =NULL;
    c -> link =NULL;
    
    //Inserting Data
    
    printf("\na data=?");
    scanf("%d",&a -> info);
    printf("\nb data=?");
    scanf("%d",&b -> info);
    printf("\nc data=?");
    scanf("%d",&c -> info);
    
    //Linking
    a ->link = b;
    b ->link = c;
    
    printf("\na info %d", a -> info);
    
    
    
    putchar('\n');
    return 0;
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs