MCQOPTIONS
Saved Bookmarks
This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which type of files can’t be opened using fopen()? |
| A. | .txt |
| B. | .bin |
| C. | .c |
| D. | none of the mentioned |
| Answer» E. | |
| 2. |
Which of the following mode argument is used to truncate? |
| A. | a |
| B. | f |
| C. | w |
| D. | t |
| Answer» D. t | |
| 3. |
What is meant by ‘a’ in the following C operation? |
| A. | Attach |
| B. | Append |
| C. | Apprehend |
| D. | AddView Answer |
| Answer» C. Apprehend | |
| 4. |
In C language, FILE is of which data type? |
| A. | int |
| B. | char * |
| C. | struct |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 5. |
When a C program is started, O.S environment is responsible for opening file and providing pointer for that file? |
| A. | Standard input |
| B. | Standard output |
| C. | Standard error |
| D. | All of the mentioned |
| Answer» E. | |
| 6. |
What is the return value of getc()? |
| A. | The next character from the stream is not referred by file pointer |
| B. | EOF for end of file or error |
| C. | Nothing |
| D. | None of the mentioned |
| Answer» C. Nothing | |
| 7. |
What will fopen will return, if there is any error while opening a file? |
| A. | Nothing |
| B. | EOF |
| C. | NULL |
| D. | Depends on compiler |
| Answer» D. Depends on compiler | |
| 8. |
For binary files, a ___ must be appended to the mode string. |
| A. | Nothing |
| B. | “b” |
| C. | “binary” |
| D. | “01” |
| Answer» C. “binary” | |
| 9. |
What are the first and second arguments of fopen? |
| A. | A character string containing the name of the file & the second argument is the mode |
| B. | A character string containing the name of the user & the second argument is the mode |
| C. | A character string containing file pointer & the second argument is the mode |
| D. | None of the mentioned |
| Answer» B. A character string containing the name of the user & the second argument is the mode | |