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

What does the function ftell(fp) return in file handling?

Q.62Medium

Which of the following correctly reads a string from file with size limit?

Q.63Medium

A program needs to update specific bytes in the middle of a file without affecting other data. Which approach is most suitable?

Q.64Medium

What is the difference between 'rb' and 'r' modes when opening a file?

Q.65Medium

In a file opened with 'rb+' mode, what operations can be performed?

Q.66Medium

A program reads structured data: fread(ptr, sizeof(struct), count, fp). If fread() returns a value less than 'count', what could be the reason?

Q.67Hard

How can you determine the size of a file in bytes using standard C functions?

Q.68Hard

When writing binary structures with fwrite(), which precaution is essential for portability across different systems?

Q.69Hard

A program processes a file with multiple reading and writing operations without closing/reopening. What is a potential issue with file buffering?

Q.70Medium

In competitive exam file handling questions, if fseek() is called with SEEK_CUR, what does it indicate?

Q.71Medium

A C program must securely close a file and handle potential errors. What is the best approach?

Q.72Hard

Which scenario would be most problematic when using fprintf() for data that needs exact binary preservation?

Q.73Hard

For reading a configuration file line-by-line where lines may exceed 256 characters, which function is recommended for ISRO/GATE 2024 exams?

Q.74Easy

Which file opening mode allows both reading and writing without truncating existing content?

Q.75Easy

What does fseek(fp, 0, SEEK_END) accomplish?

Q.76Easy

Which function returns the current position of file pointer?

Q.77Easy

Which mode opens file in text format with write permission only?

Q.78Medium

A program needs to append 500 integers to an existing binary file. Which combination is correct?

Q.79Medium

What happens if you call fclose() on an already closed file pointer?

Q.80Medium

A program reads struct records using fread(). After reading 100 records of 64 bytes each, what is the total bytes read if successful?