What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun(char *msg, ...); int main() { fun("IndiaBIX", 1, 4, 7, 11, 0); return 0; } void fun(char *msg, ...) { va_list ptr; int num; va_start(ptr, msg); num = va_arg(ptr, int); num = va_arg(ptr, int); printf("%d", num); }

Review the verified answer and explanation for this DemoPaper-Pakistan past-paper question on CampusFin.

What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun(char *msg, ...); int main() { fun("IndiaBIX", 1, 4, 7, 11, 0); return 0; } void fun(char *msg, ...) { va_list ptr; int num; va_start(ptr, msg); num = va_arg(ptr, int); num = va_arg(ptr, int); printf("%d", num); } Answer: 4

Question context

This question is part of 💡 C Programming within the broader 💻 Programming subject and appears in the DemoPaper-Pakistan preparation collection. Reviewing the answer together with nearby questions helps reinforce the underlying concept and identify how it may appear in competitive exams.