6
Loading subject content…
Loading subject content…
Loading practice questions…
What will be the output of the program?
#include <stdio.h>
struct N { int v; struct N *next; };
int main(void) {
struct N c = {3, NULL}, b = {2, &c}, a = {1, &b};
int s = 0;
struct N *p;
for (p = &a; p; p = p->next) s += p->v;
printf("%d\n", s);
return 0;
}What will be the output of the program?
#include <stdio.h>
struct Date { int d, m, y; };
int main(void) {
struct Date t = {.y = 2024, .d = 15};
printf("%d %d %d\n", t.d, t.m, t.y);
return 0;
}