}
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;
}
" class="related-a">
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;
}