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 program reads struct records using fread(). After reading 100 records of 64 bytes each, what is the total bytes read if successful?

Q.42Medium

Which statement correctly counts non-comment lines in a text file?

Q.43Medium

In a program processing a CSV file, what is the most robust approach for reading variable-length lines?

Q.44Medium

A file opened with 'r+b' mode has pointer at position 100. After fwrite(buffer, 1, 50, fp), the pointer is at:

Q.45Medium

Which approach correctly implements a file copy function for both text and binary files?

Q.46Medium

A program crashes after reading a file. What's most likely the cause if error checking is minimal?

Q.47Medium

For a file with 1000 records, which approach minimizes I/O operations?

Q.48Medium

A program needs to read and write to the same file alternately. Which file mode is most appropriate?

Q.49Medium

What will be the output of fseek(fp, -10, SEEK_END) in a file of 100 bytes?

Q.50Medium

In a data structure serialization scenario, what is returned by fwrite() on successful completion?

Q.51Medium

A competitive exam question requires processing a 500MB CSV file line by line. Which approach is most efficient in terms of memory?

Q.52Medium

What is the critical issue if ferror(fp) returns non-zero during file operations in a banking application?