File Handling - C (MCQ) questions and answers

31. A file written in text mode can be read back in binary mode.

A. Yes
B. No

View Answer

32. A file written in text mode can be read back in binary mode.

A. Yes
B. No

View Answer

33. A text stream is an ordered sequence of characters composed into lines, each line consisting of zero or more characters plus a terminating new-line character.

A. True
B. False

View Answer


34. While calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.

A. True
B. False

View Answer


35. Select text file in which number will take.

A. 2 bytes
B. 4 bytes
C.3 bytes
D. 8bytes

View Answer


36. Which is true about getc.getc returns?

A. The next character from the stream referred to by file pointer
B. EOF for end of file or error
C. Both a & b
D. Nothing

View Answer


37. What is the meant by ‘a’ in the following operation?

fp = fopen(“letsfindcourse.txt”, “a”);

A. Attach
B. Append
C. Apprehend
D. Add

View Answer


38. What does the following segment of code do? fprintf(fp, “Copying!”);

A. It writes “Copying!” into the file pointed by fp
B. It reads “Copying!” from the file and prints on display
C. It writes as well as reads “Copying!” to and from the file and prints it
D. None of the mentioned

View Answer


39. _____removes the named file, so that a subsequent attempt to open it will fail.

A. remove(const *filename)
B. remove(filename)
C. remove()
D. fclose(filename)

View Answer


40. EOF is an integer type defined in stdio. hand has a value ____________

A. 1
B. 0
C. NULL
D. – 1

View Answer







Also check :


Discussion


* You must be logged in to add comment.