Write the syntax in C to create a node in the singly linked list.

bookmark

  1. struct node   
  2. {  
  3.     int data;   
  4.     struct node *next;  
  5. };  
  6. struct node *head, *ptr;   
  7. ptr = (struct node *)malloc(sizeof(struct node));