adplus-dvertising

Welcome to the File Handling in C MCQs Page

Dive deep into the fascinating world of File Handling in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of File Handling in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of File Handling in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through File Handling in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of File Handling in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

File Handling in C MCQs | Page 1 of 6

Discuss
Answer: (d).FILE is a structure and fp is a pointer to the structure of FILE type
Discuss
Answer: (a).A character string containing the name of the file & the second argument is the mode
Discuss
Answer: (c).In rewind, there is no way to check if the operations completed successfully
Discuss
Answer: (d).It is a type name defined in stdio.h
Q5.
Which type of files can't be opened using fopen()?
Discuss
Answer: (d).None of the above
Q6.
If there is any error while opening a file, fopen will return?
Discuss
Answer: (c).NULL
Q7.
It is not possible to combine two or more file opening mode in open () method.
Discuss
Answer: (b).False
Q8.
What is the purpose of "rb" in fopen() function used below in the code?
FILE *fp;
fp = fopen("demo.txt", "rb");
Discuss
Answer: (a).Open "demo.txt" in binary mode for reading
Q9.
Which files will get closed through the fclose() in the following program?
void main()
{
       FILE *fp, *ft;
       fp = fopen("a.txt", "r");
       ft = fopen("b.txt", "r");
       fclose(fp,ft);
}
Discuss
Answer: (d).Error in fclose
Q10.
When fopen() is not able to open a file, it returns
Discuss
Answer: (b).NULL
Page 1 of 6

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!