15 333 31 21 17 31 15 21 333 17
180 3996 372 252 204 17 31 15 17 36 19
15 333 31 21 17
What will be the output of the given program?
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
};
void ab(struct node* head)
{
if(head == NULL)
return;
ab(head–>next);
printf("%d ", head–>data*12);
}
void de(struct node* start)
{
if(start == NULL)
return;
printf("%d ", start–>data);
if(start–>next != NULL )
de(start–>next–>next);
printf("%d ", start–>data*7/6);
}
void p(struct node** head_ref, int new_data)
{
struct node* new_node =(struct node*) malloc(sizeof(struct node));
new_node–>data = new_data;
new_node–>next = (*head_ref);
(*head_ref) = new_node;
}
int main()
{
struct node* head = NULL;
p(&head, 15);
p(&head, 333);
p(&head, 31);
p(&head, 21);
p(&head, 17);
ab(head);
de(head);
getchar();
return 0;
}
Correct Answer:
180 3996 372 252 204 17 31 15 17 36 19
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Embedded C MCQ Questions