C Programming - Input / Output
Exercise : Input / Output - Yes / No Questions
1.
stderr, stdin, stdout are FILE pointers
Answer: Option
Explanation:
Yes, these will be declared like
The corresponding stdio.h variable is FILE* stdin;
The corresponding stdio.h variable is FILE* stdout;
The corresponding stdio.h variable is FILE* stderr;
2.
A file written in text mode can be read back correctly in binary mode.
Answer: Option
Explanation:
If you write a file in text mode and then read it back in binary mode, the translations performed in text mode may result in the file's contents being misinterpreted or incorrectly read in binary mode. For consistent behavior, a file should be read and written in the same mode (both text or both binary).
3.
Will the following program work?
#include<stdio.h>
int main()
{
int n=5;
printf("n=%*d\n", n, n);
return 0;
}
Answer: Option
Explanation:
It prints n= 5
4.
Can we specify a variable filed width in a scanf() format string?
Answer: Option
Explanation:
In scanf() a * in a format string after a % sign is used for the suppression of assignment. That is, the current input field is scanned but not stored.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers