0
What is the output of the following C program?
#include <stdio.h>
struct node { int v; struct node *next; };
int main() {
struct node a = {1, 0}, b = {2, 0}, c = {3, 0};
a.next = &b; b.next = &c;
struct node *p = &a;
int s = 0;
while (p) { s += p->v; p = p->next; }
printf("%d %d", s, a.next->next->v);
return 0;
}- A3 3
- B6 2
- C6 3
- D3 6
Correct answer: C