Can we specify a variable filed width in a scanf() format string?
A:
Yes
B:
No
C:
D:
Answer:B
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.
Discuss About this Question.
Will the following program work?
#include<stdio.h>
int main()
{
int n=5;
printf("n=%*d\n", n, n);
return 0;
}
A:
Yes
B:
No
C:
D:
Answer:A
It prints n= 5
Discuss About this Question.
A file written in text mode can be read back correctly in binary mode.
A:
Yes
B:
No
C:
D:
Answer:B
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).
Discuss About this Question.
stderr, stdin, stdout are FILE pointers
A:
Yes
B:
No
C:
D:
Answer:A
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;
Discuss About this Question.
In a call to printf() function the format specifier %b can be used to print binary equivalent of an integer.
A:
True
B:
False
C:
D:
Answer:B
There is no format specifier named %b in c.
Discuss About this Question.
Ad Slot (Above Pagination)
Install ExamAdept
Fast access — add this app to your device.
To install on iPhone/iPad: tap Share → Add to Home Screen.
Discuss About this Question.