Home » C Programming » Structures » Question
  1. Which of the following will stop the loop at the last node of a linked list in the following C code snippet?
    struct node
    {
    struct node *next;
    };
    1. while (p->next != NULL)
      {
      p = p->next;
      }
    2. while (1)
      {
      p = p->next;
      if (p == NULL)
      break;
      }
    3. while (p != NULL)
      {
      p = p->next;
      }
    4. All of above
    5. None of these
Correct Option: A

None of these



Your comments will be displayed only after manual approval.