C Programming
INPUT / OUTPUT MCQs
Total Questions : 35
Page 1 of 4 pagesIn 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.
It prints n= 5
The difference is that text files contain lines (or records) of text and each of these
has an end-of-line marker automatically appended to the end of it whenever you
indicate that you have reached the end of a line.
Binary files are not broken up into separate lines or records so the end-of line marker
is not written when writing to a binary file.
So, we cannot read the correct the data in binary mode.
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;
There is no format specifier named %b in c.
True, we should not be able to read a file after writing in that file without calling the below
functions.
int fflush ( FILE * stream ); If the given stream was open for writing and the last i/o operation
was an output operation, any unwritten data in the output buffer is written to the file.
int fseek ( FILE * stream, long int offset, int origin ); Its purpose is to change the file position
indicator for the specified stream.
void rewind ( FILE * stream ); Sets the position indicator associated with stream to the
beginning of the file.
True, offset in fseek() function can be a negative number. It makes the file pointer to
move backwards from the current position.
Declaration: retval = fseek( fp, offset, from );
Where:
FILE *fp; = points to the file on which I/O is to be repositioned.
long offset; = is an integer giving the number of bytes to move forward or backward in
the file. This may be positive or negative.
int from; = is one of the manifests SEEK_SET, SEEK_CUR, or SEEK_END.
int retval; = is non-zero if the seek operation was invalid (e.g. on a file not opened with
a "b" option); otherwise, the return value is zero.
True, each line may contain zero or more characters terminated by a newline character.
This program get the input string from the user through gets function and store it
in the file f1.txt using fputsfunction.
The %s format specifier tells the compiler the given input was string of characters
Recent Questions
Q. The Frequency Of Oscillation At Compared To Earth Will Be
Q. The Formula In Which Σ(x-x̅)² Is Divided By One Less ....
Q. If....
Q. What Is The National Sport Of Canada(in Winter And Summer)?
Q. A Well-oiled Machinery For The Creation And Diffusion Of Fad....
Q. Considering All 2-digit Natural Numbers, How Many Values Of ....
Q. In A Gas Welding Of Mild Steel Using An Oxyacetylene Flame, ....
Q. Which One Of Following Fuels Is Used By Slow Thermal Nuclear....
Q. Answer The Questions On The Basis Of The Following Informat....
Q. Who Discovered The Path Of Circulation Of Blood In The Human....
Q. __________ Is Produced Using Molasses As The Starting Raw Ma....
Q. &n....
Q. `3....
Q. The Ratio Of Mass Concentration Of Species A To The Total M....
Q. Which Pesticide Killed Many Other Organisms Instead Of Only ....
Q. Resolution Of A DVM Is Given By ____________
Q. Who Has Hinted At The Possible Community Transmission Of The....
Q. The Ability Of Money To Be Moved Easily Is Called:
Q. EXORBITANT
Q. An Inventory, Which Consists Of Partially Worked Goods Is Ca....