iGET

C Programming - MCQ Practice Questions

Practice free C Programming multiple-choice questions with detailed answers and explanations. Perfect for competitive exam preparation.

978 questions | 100% Free

Q.721Easy

Which function writes formatted output to a file?

Q.722Medium

A file is opened in binary mode. How will fseek() behave differently compared to text mode?

Q.723Easy

What will fseek(fp, 0, SEEK_END) do?

Q.724Medium

A program uses fprintf() to write 1000 integers to a file but doesn't call fclose(). What could happen?

Q.725Easy

Which function reads formatted data from a file?

Q.726Easy

What is returned by fopen() if file opening fails?

Q.727Medium

A binary file contains 500 structures of size 32 bytes each. To skip the first 10 structures and read the 11th one, which fseek() call is correct?

Q.728Medium

Which of the following modes will truncate an existing file?

Q.729Medium

A program reads a CSV file with fgets() storing data in a 256-byte buffer. Some lines exceed 255 characters. How should this be handled?

Q.730Medium

What does fflush(fp) do when fp is a file pointer?

Q.731Hard

A program writes binary data using fwrite() but reads it back with fprintf(). What will happen?

Q.732Medium

In a file opened in "a+" mode, where does the file pointer initially point?

Q.733Hard

A program uses fgetc() to read 100,000 characters from a file sequentially. Which alternative would be more efficient?

Q.734Easy

What does the third parameter of fseek() represent?

Q.735Hard

A large binary file of 10GB is being processed. Reading entire file into memory is impossible. Which approach is best?

Q.736Easy

Which header file must be included to use file handling functions in C?

Q.737Easy

What does the 'w+' mode do when opening a file with fopen()?

Q.738Easy

Which function is used to write a single character to a file?

Q.739Easy

What is the return value of feof(fp) when the end of file is reached?

Q.740Easy

In C file handling, what does rewind(fp) do?