in Programming
1,559 views
2 votes
2 votes

What will be the output of following programs :

void fun1(struct node* head)

 {

    for(head == NULL)
    {
        return;
    }

    fun1(head->next);

    printf("%d  ", head->data);
 }

 And this one !

 

void fun1(struct node* head)

 {

    while(head == NULL)
    {
        return;
    }

    fun1(head->next);

    printf("%d  ", head->data);
 }



 

in Programming
by
1.6k views

4 Comments

@_shashi hope you have noticed. :) @iarnav you're welcome.

0
0

@junk_mayavi thanks for the correction :)

1
1

thanks @junk_mayavi... you cleared my doubt.. i was thinking both will print linked list in reverse order... thanks.

0
0

Please log in or register to answer this question.

Related questions