InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 101. |
For binary files, a ___ must be appended to the mode string.(a) Nothing(b) “b”(c) “binary”(d) “01”I got this question in a national level competition.This question is from File Access topic in section Input and Output in C of C |
|
Answer» RIGHT CHOICE is (B) “b” The EXPLANATION: NONE. |
|
| 102. |
Which among the following is the odd one out?(a) printf(b) fprintf(c) putchar(d) scanfI have been asked this question during a job interview.I want to ask this question from Standard Input & Output in chapter Input and Output in C of C |
|
Answer» The CORRECT OPTION is (d) scanf |
|
| 103. |
If by mistake you specify more number of arguments, the excess arguments will ____________(a) be ignored(b) produce compile error(c) produce run-time error(d) produce logical errorI had been asked this question during an online exam.This question is from printf in division Input and Output in C of C |
|
Answer» The CORRECT answer is (a) be ignored |
|
| 104. |
What symbol is used to Left-justify within the data given field width?(a) -(minus sign)(b) +(plus sign)(c) #(d) 0I got this question in a national level competition.My enquiry is from printf in chapter Input and Output in C of C |
|
Answer» Right choice is (a) -(MINUS sign) |
|
| 105. |
What is function srand(unsigned)?(a) Sets the seed for rand(b) Doesn’t exist(c) Is an error(d) None of the mentionedI have been asked this question in examination.This interesting question is from Random Number Generation topic in section Input and Output in C of C |
|
Answer» CORRECT CHOICE is (a) SETS the SEED for rand Explanation: NONE. |
|
| 106. |
Which types of input are accepted in toupper(c)?(a) char(b) char *(c) float(d) Both char and char *The question was posed to me during an internship interview.The doubt is from Character Class Testing & Conversions in section Input and Output in C of C |
|
Answer» The CORRECT ANSWER is (a) char |
|
| 107. |
stderr is similar to?(a) stdin(b) stdout(c) both stdout and stdin(d) none of the mentionedI had been asked this question in an interview for job.Asked question is from Error Handling in chapter Input and Output in C of C |
|
Answer» CORRECT ANSWER is (a) stdin The BEST EXPLANATION: NONE. |
|
| 108. |
Within main, return expr statement is equivalent to ________(a) abort(expr)(b) exit(expr)(c) ferror(expr)(d) none of the mentionedI had been asked this question in my homework.This key question is from Error Handling in section Input and Output in C of C |
|
Answer» RIGHT CHOICE is (b) exit(EXPR) The explanation is: None. |
|
| 109. |
Which of the following is an invalid method for input?(a) scanf(“%d%d%d”,&a, &b, &c);(b) scanf(“%d %d %d”, &a, &b, &c);(c) scanf(“Three values are %d %d %d”,&a,&b,&c);(d) none of the mentionedI had been asked this question during an online exam.This question is from Formatted Input in section Input and Output in C of C |
|
Answer» RIGHT ANSWER is (d) NONE of the mentioned The BEST EXPLANATION: None. |
|
| 110. |
Which of the following function with ellipsis are illegal?(a) void func(…);(b) void func(int, …);(c) void func(int, int, …);(d) none of the mentionedI got this question during an interview.This key question is from Variable Length Argument topic in portion Input and Output in C of C |
|
Answer» RIGHT choice is (a) VOID func(…); The explanation is: NONE. |
|
| 111. |
What is the difference between %e and %g?(a) %e output formatting depends on the argument and %g always formats in the format [-]m.dddddd or [-]m.dddddE[+|-]xx where no.of ds are optional(b) %e always formats in the format [-]m.dddddd or [-]m.dddddE[+|-]xx where no.of ds are optional and output formatting depends on the argument(c) No differences(d) Depends on the standardThis question was posed to me in homework.My question is taken from Formatted Output topic in section Input and Output in C of C |
|
Answer» RIGHT ANSWER is (b) %e ALWAYS formats in the format [-]m.dddddd or [-]m.dddddE[+|-]XX where no.of ds are optional and output formatting depends on the argument Explanation: None. |
|
| 112. |
What is the function of the mode ‘ w+’?(a) create text file for writing, discard previous contents if any(b) create text file for update, discard previous contents if any(c) create text file for writing, do notdiscard previous contents if any(d) create text file for update, do not discard previous contents if anyI had been asked this question in semester exam.I'm obligated to ask this question of File Operations in division Input and Output in C of C |
|
Answer» Right answer is (B) create text FILE for update, discard previous contents if any |
|
| 113. |
Which one of the following is correct syntax for openinga file.(a) FILE *fopen(const *filename, const char *mode)(b) FILE *fopen(const *filename)(c) FILE *open(const *filename, const char *mode)(d) FILE open(const*filename)The question was asked in final exam.My question is based upon File Operations in section Input and Output in C of C |
|
Answer» Correct choice is (a) FILE *fopen(const *FILENAME, const CHAR *mode) |
|
| 114. |
Which among the following is correct function call for rand() and random()?(a) rand() and random();(b) rand() and random(1);(c) rand(1) and random(1);(d) rand(1) and random();I have been asked this question at a job interview.This interesting question is from Random Number Generation in portion Input and Output in C of C |
|
Answer» Right answer is (a) RAND() and RANDOM(); |
|
| 115. |
function fabs defined math.h header file takes the argument of type integer.(a) True(b) False(c) Depends on the implementation(d) Depends on the standardI got this question in a national level competition.Query is from Mathematical Functions in division Input and Output in C of C |
|
Answer» CORRECT OPTION is (B) False Explanation: NONE. |
|
| 116. |
calloc() returns storage that is initialized to.(a) Zero(b) Null(c) Nothing(d) OneI got this question during an internship interview.This interesting question is from Storage Management topic in section Input and Output in C of C |
|
Answer» CORRECT ANSWER is (a) Zero Easy EXPLANATION - NONE. |
|
| 117. |
The function ____ obtains a block of memory dynamically.(a) calloc(b) malloc(c) both calloc & malloc(d) freeI had been asked this question in unit test.My query is from Storage Management topic in portion Input and Output in C of C |
|
Answer» The correct CHOICE is (C) both calloc & malloc |
|
| 118. |
ungetc() can be used only with getc().(a) true(b) false(c) depends on the standard(d) depends on the platformI have been asked this question in an internship interview.This interesting question is from Ungetc topic in section Input and Output in C of C |
|
Answer» CORRECT ANSWER is (B) false Easy EXPLANATION - NONE. |
|
| 119. |
stderr is similar to?(a) stdin(b) stdout(c) Both stdout and stdin(d) None of the mentionedThe question was asked in exam.Enquiry is from Error Handling in section Input and Output in C of C |
|
Answer» Right answer is (B) stdout |
|
| 120. |
What is the return value of getc()?(a) The next character from the stream is not referred by file pointer(b) EOF for end of file or error(c) Nothing(d) None of the mentionedThis question was posed to me by my college director while I was bunking the class.My question comes from File Access topic in division Input and Output in C of C |
|
Answer» Correct option is (B) EOF for end of file or error |
|
| 121. |
putchar(c) function/macro always outputs character c to the __________(a) screen(b) standard output(c) depends on the compiler(d) depends on the standardThis question was addressed to me in semester exam.I want to ask this question from Standard Input & Output in section Input and Output in C of C |
|
Answer» The correct choice is (B) STANDARD output |
|