Here is a listing of C interview questions on “Variable Length Argument” along with answers, explanations and/or solutions: 1.The standard header _______ is used for variable list arguments (…) in C. a) <stdio.h > b) <stdlib.h> c) <math.h> d) <stdarg.h> 2. va_end does whatever. a) Cleanup is necessary b) Bust be called before the program […]
C MCQs: Variable Length Arguments- Part 1
Here is a listing of C programming questions on “Variable Length Argument” along with answers, explanations and/or solutions: 1. What is the output of this C code?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #include <stdio.h> #include <stdarg.h> void func(int, ...); int main() { func(2, 3, 5, 7, 11, 13); return 0; } void func(int n, ...) { int number, i = 0; va_list start; va_start(start, n); while (i != 3) { number = va_arg(start, int); i++; } printf("%d", number); } |
a) 3 b) 5 c) 7 d) 11 2. Which of the following function with ellipsis are illegal? a) void func(…); b) void func(int, …); c) void […]
C MCQs: Formatted Output- Part 2
Welcome to MCQ QUIZ for preperation for C programming tests for various interviews: Here is a listing of advanced C interview questions on Formatted Output along with answers, explanations and/or solutions: 1. What does this statement printf(“%10s”, state); means? a) 10 spaces before the string state is printed b) Print empty spaces if the string […]
C MCQs: Formatted Output – Part 1
Welcome to MCQ QUIZ for preperation for C programming tests for various interviews: Here is a listing of advanced C interview questions on Formatted Output along with answers, explanations and/or solutions: 1. What is the output of this C code?
1 2 3 4 5 6 7 8 9 10 | #include int main() { int i = 10, j = 2; printf("%d\n", printf("%d %d ", i, j)); } |
a) Compile time error b) 10 2 4 c) 10 2 2 d) 10 […]
C MCQs: Standard Input and Output- Part 2
Welcome to MCQ QUIZ for preperation for C programming tests for various interviews: Here is a listing of C interview questions on “Standard Input & Output” along with answers, explanations and/or solutions: 1. Which is true about function tolower? a) The function tolower is defined in b) Converts an upper case letter to lower […]
C MCQs: Standard Input and Output- Part 1
Welcome to MCQ QUIZ for preperation for C programming tests for various interviews: Here is a listing of C multiple choice questions on “Standard Input and Output” along with answers, explanations and/or solutions: 1. Which among the following is odd one out? a) printf b) fprintf c) putchar d) scanf 2. For a typical program, […]