C MCQs: File Access- Part 2

Here is a listing of C programming questions on “File Access” along with answers, explanations and/or solutions: 1. Which of the following fopen statements are illegal? a) fp = fopen(“abc.txt”, “r”); b) fp = fopen(“/home/user1/abc.txt”, “w”); c) fp = fopen(“abc”, “w”); d) None of the mentioned 2. What does the following segment of code do? fprintf(fp, “Copying!”); a) It writes…

C MCQs: File Access- Part 1

Here is a listing of C programming interview questions on “File Access” along with answers, explanations and/or solutions: 1. The first and second arguments of fopen are a) A character string containing the name of the file & the second argument is the mode. b) A character string containing the name of the user & the second argument is the…

C MCQs: Variable Length Arguments- Part 2

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 returns. c) Both a &…

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 state is less than 10…

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? #include int main() { int i = 10, j = 2; printf(“%d\n”, printf(“%d %d “, i, j)); } a) Compile…

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 case c) returns other characters…