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.41Medium

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

Q.42Easy

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

Q.43Medium

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

Q.44Easy

Which function reads formatted data from a file?

Q.45Easy

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

Q.46Medium

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.47Medium

Which of the following modes will truncate an existing file?

Q.48Medium

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.49Medium

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

Q.50Hard

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

Q.51Medium

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

Q.52Hard

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

Q.53Easy

What does the third parameter of fseek() represent?

Q.54Hard

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

Q.55Easy

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

Q.56Easy

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

Q.57Easy

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

Q.58Easy

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

Q.59Easy

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

Q.60Medium

Which mode allows both reading and appending without truncating existing content?