Skip to content

Tag Archives: C-File Handling

Write a C program that displays contents of given line page by page. Given number of lines to show as ‘n’ at a time and… Read More
fseek() should be preferred over rewind() mainly because (A) rewind() doesn’t work for empty files (B) rewind() may fail for large files (C) In rewind,… Read More
In fopen(), the open mode “wx” is sometimes preferred “w” because. 1) Use of wx is more efficient. 2) If w is used, old contents… Read More
getc() returns EOF when (A) End of files is reached (B) When getc() fails to read a character (C) Both of the above (D) None… Read More
When fopen() is not able to open a file, it returns (A) EOF (B) NULL (C) Runtime Error (D) Compiler Dependent Answer: (B) Explanation: fopen()… Read More
Which of the following true about FILE *fp (A) FILE is a keyword in C for representing files and fp is a variable of FILE… Read More
In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified.  When mode “w”… Read More
In C, fseek() should be preferred over rewind(). Note the following text C99 standard: The rewind function sets the file position indicator for the stream… Read More
In C/C++, getc() returns EOF when end of file is reached. getc() also returns EOF when it fails. So, only comparing the value returned by… Read More

Start Your Coding Journey Now!