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.1Easy

Which function is used to open a file in C?

Q.2Easy

What does the mode 'rb' mean in fopen()?

Q.3Easy

Which function is used to close a file in C?

Q.4Easy

Which mode opens a file for writing and truncates it if it exists?

Q.5Easy

When opening a file in 'w' mode, what happens if the file already exists?

Q.6Easy

Which of the following file modes in fopen() allows reading only?

Q.7Easy

In file handling, what does the 'b' flag in file modes like 'rb' or 'wb' indicate?

Q.8Easy

Which function is used to determine the current position in a file?

Q.9Easy

What is the correct syntax to open a file named 'data.txt' in read mode?

Q.10Easy

Which mode allows both reading and writing to a file, creating it if it doesn't exist?

Q.11Easy

What does the fclose() function do?

Q.12Easy

Which function writes formatted output to a file?

Q.13Easy

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

Q.14Easy

Which function reads formatted data from a file?

Q.15Easy

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

Q.16Easy

What does the third parameter of fseek() represent?

Q.17Easy

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

Q.18Easy

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

Q.19Easy

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

Q.20Easy

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