C Saved Program: placid-city

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<conio.h>
#include<alloc.h>
  struct node
  {
      int info;
      struct node  *link;
  };
    struct node *first;

    void main ()
    {
        void create ();
        clrscr();
        create();
        getch();
    }
      void create()
      {
          struct node *ptr, *cpt;
          char ch;
          ptr=(struct node*) malloc (sizeof (struct node))
          printf("input first node information");
          scanf("%d",&ptr->info);
          first=ptr;
          do
      {
          cpt=(struct node*) malloc(sizeof(struct node));
          print("input next node information");
          scanf("%d",&cpt->info);
          ptr->link=cpt;
          ptr=cpt;
        printf("press <Y/N> for more node");
          ch=getch();

      }
       while (ch=='Y');
       ptr->link=NULL;

  }

}
Execute

Output

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

Inputs