What does the following function do for a given Linked List with first node as…

PYQ TCS NQT 2025

What does the following function do for a given Linked List with first node as head?

void fun1(struct node* head)
{
    if (head == NULL)
        return;
    fun1(head->next);
    printf("%d ", head->data);
}
  1. A.

    Prints all nodes of linked lists

  2. B.

    Prints all nodes of linked list in reverse order

  3. C.

    Prints alternate nodes of Linked List

  4. D.

    Prints alternate nodes in reverse order

Attempted by 17 students.

Sign up free to check your answer

Sign up free

Explore the full course: Cdac C Cat Complete Preparation

Loading lesson…