Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 34
Q761:
What structure stores the file header descriptor?
A. RECORD
B. HEADER
C. OVERLAPPED
D. SYSTEMTIME
Correct Answer: B
Chapter: 34
Q762:
Which Windows API function reads data from a file into a buffer?
A. WriteFile
B. ReadFile
C. CreateFile
D. CloseHandle
Correct Answer: B
Chapter: 34
Q763:
Which Windows API function writes data from a buffer to a file?
A. WriteFile
B. ReadFile
C. CreateFile
D. CloseHandle
Correct Answer: A
Chapter: 34
Q764:
How does the program remove the newline character after reading input string?
A. Using string[_tcslen(string)-1] = _T('\0');
B. Using fgets()
C. Using gets()
D. Using strlen()
Correct Answer: A
Chapter: 34
Q765:
What happens when writing a record for the first time (referenceCount == 0)?
A. recordCreationTime is set to currentTime
B. numNonEmptyRecords is decremented
C. referenceCount remains zero
D. recordUpdateTime is ignored
Correct Answer: A
Chapter: 34
Q766:
Which variable holds the current file pointer position?
A. currentPtr
B. ov
C. nXfer
D. hFile
Correct Answer: A
Chapter: 34
Q767:
If the recordChange flag is TRUE, what does the program do next?
A. Write the updated record back to the file
B. Deletes the record
C. Reads a new record
D. Closes the file
Correct Answer: A
Chapter: 34
Q768:
Which of the following is NOT a valid command in this program?
A. r
B. w
C. d
D. x
Correct Answer: D
Chapter: 34
Q769:
What does the OVERLAPPED structure 'ov' help manage?
A. File position for asynchronous I/O
B. Memory allocation
C. Network communication
D. Thread synchronization
Correct Answer: A
Chapter: 34
Q770:
Which function is used to get the current system time?
A. GetCurrentTime
B. GetSystemTime
C. GetLocalTime
D. SetSystemTime
Correct Answer: B
Chapter: 34
Q771:
If a record's referenceCount is incremented, what does it signify?
A. The record has been updated
B. The record is empty
C. The record is deleted
D. The record is locked
Correct Answer: A
Chapter: 34
Q772:
What type of file is created when argc > 2 and _ttoi(argv[2]) <= 0?
A. Existing file
B. New file
C. Read-only file
D. Empty file
Correct Answer: A
Chapter: 34
Q773:
The file header is written using which function?
A. ReadFile
B. WriteFile
C. SetFilePointerEx
D. CloseHandle
Correct Answer: B
Chapter: 34
Q774:
What happens if WriteFile fails when updating the record?
A. ReportError is called
B. The program silently continues
C. The record is deleted
D. The program quits silently
Correct Answer: A
Chapter: 34
Q775:
In the main loop, what is the condition to exit?
A. Command 'q' is entered
B. Command 'x' is entered
C. EOF is reached
D. Record number exceeds numRecords
Correct Answer: A
Chapter: 34
Q776:
Which structure member contains the time the record was last updated?
A. recordCreationTime
B. recordUpdateTime
C. recordLastRefernceTime
D. dataString
Correct Answer: B
Chapter: 34
Q777:
What does the _tscanf function read from the user?
A. Command character and record number
B. Command only
C. Record number only
D. File name
Correct Answer: A
Chapter: 34
Q778:
What is the purpose of the headerChange boolean?
A. Indicates if header data changed
B. Indicates if record data changed
C. Indicates if file is corrupted
D. Indicates if file is empty
Correct Answer: A
Chapter: 34
Q779:
Which system header is likely included for SYSTEMTIME and DWORD types?
A. Windows.h
B. Stdlib.h
C. Stdio.h
D. String.h
Correct Answer: A
Chapter: 34
Q780:
Which function is called to close the file handle?
A. CloseFile
B. CloseHandle
C. FileClose
D. CloseStream
Correct Answer: B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now