Vidyalelo
C Programming · all questions

File Input Output
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

296

Questions

1/15

Page

Pick an option on a question to see the right answer and solution.

In C, which library is used for file operations such as reading and writing files?

Select an option to see the answer and solution.

Which function is used to open a file in C for writing?

Select an option to see the answer and solution.

What does 'FILE' represent in C when working with files?

Select an option to see the answer and solution.

How do you check if a file was opened successfully in C?

Select an option to see the answer and solution.

Which function is used to write data to a file in C?

Select an option to see the answer and solution.

What is the difference between 'r' and 'w' modes when opening a file in C?

Select an option to see the answer and solution.

How do you read a character from a file in C?

Select an option to see the answer and solution.

What is the purpose of the 'fprintf' function in C?

Select an option to see the answer and solution.

Which function is used to close a file in C?

Select an option to see the answer and solution.

In C, what is the function of the 'feof' function?

Select an option to see the answer and solution.

Which function is used to move the file pointer to a specific position in a file?

Select an option to see the answer and solution.

What is the purpose of the 'rewind' function in C?

Select an option to see the answer and solution.

Which function is used to read a line of text from a file in C?

Select an option to see the answer and solution.

What is the difference between 'r+' and 'w+' modes when opening a file in C?

Select an option to see the answer and solution.

Which function is used to delete a file in C?

Select an option to see the answer and solution.

What does the 'fread' function in C do?

Select an option to see the answer and solution.

Which function is used to rename a file in C?

Select an option to see the answer and solution.

In C, what does the 'feof' function return if the end of the file is reached?

Select an option to see the answer and solution.

How do you check if a file exists in C?

Select an option to see the answer and solution.

What is the purpose of the 'ftell' function in C?

Select an option to see the answer and solution.