Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 14
Q361:
If a file is not opened in concurrent mode, ReadFile() starts reading from _______.
A. The beginning of the file
B. The current file pointer position
C. The end of the file
D. The middle of the file
Correct Answer: B
Chapter: 15
Q362:
What parameter does CloseFile() API take?
A. File name
B. File handle
C. File path
D. File size
Correct Answer: B
Chapter: 15
Q363:
CloseFile() returns True when _______.
A. The file handle is invalid
B. The file is successfully closed
C. The file is still open
D. No file handle is passed
Correct Answer: B
Chapter: 15
Q364:
Closing a file handle is necessary to _______.
A. Delete the file
B. Release system resources
C. Open a new file
D. Read data from file
Correct Answer: B
Chapter: 15
Q365:
The value returned by CloseFile() API is of type _______.
A. Boolean
B. Integer
C. String
D. Pointer
Correct Answer: A
Chapter: 15
Q366:
After closing a file, the file handle becomes _______.
A. Valid
B. Invalid
C. Readable
D. Writable
Correct Answer: B
Chapter: 15
Q367:
Not closing a file handle properly can lead to _______.
A. System crash
B. Resource leak
C. File corruption
D. All of these
Correct Answer: D
Chapter: 15
Q368:
CloseFile() returns False when the file handle is _______.
A. Valid
B. Already closed
C. Open
D. None of these
Correct Answer: B
Chapter: 15
Q369:
The CloseFile() API is used to manage _______.
A. File contents
B. File handles
C. File paths
D. File extensions
Correct Answer: B
Chapter: 16
Q370:
Windows supports which character encoding standards?
A. ASCII and Unicode
B. UTF-8 and ASCII
C. Unicode and UTF-16
D. ASCII and EBCDIC
Correct Answer: A
Chapter: 16
Q371:
Unicode characters are typically represented with how many bits?
A. 8-bit
B. 16-bit
C. 32-bit
D. 64-bit
Correct Answer: B
Chapter: 16
Q372:
Which macro includes all Unicode function headers in Windows API?
A. #define_UNICODE
B. #defineUNICODE
C. #defineUNICODE_FUNC
D. #define_UNICODE_FUNC
Correct Answer: B
Chapter: 16
Q373:
What is the purpose of the #define_UNICODE macro?
A. Includes all function headers
B. Includes variable types
C. Enables ASCII support
D. Disables Unicode support
Correct Answer: B
Chapter: 16
Q374:
Generic code in Windows can work for which character types?
A. Only ASCII
B. Only Unicode
C. Both ASCII and Unicode
D. None of these
Correct Answer: C
Chapter: 16
Q375:
Which header file should be included for generic C functions using TCHAR?
A. stdio.h
B. stdlib.h
C. tchar.h
D. string.h
Correct Answer: C
Chapter: 16
Q376:
Which operator is recommended to use for sizes instead of hard coding in Unicode programming?
A. sizeof()
B. length()
C. strlen()
D. count()
Correct Answer: A
Chapter: 16
Q377:
What is the role of the _itot() function in generic programming?
A. Convert integer to ASCII
B. Convert integer to TCHAR
C. Convert string to integer
D. Convert float to integer
Correct Answer: B
Chapter: 16
Q378:
The _stprintf() function is used to _______.
A. Format strings in ASCII
B. Format strings in generic TCHAR format
C. Format only Unicode strings
D. Format binary data
Correct Answer: B
Chapter: 16
Q379:
Which macro is used to represent string constants in generic programming?
A. _TEXT or _T
B. _ASCII or _U
C. _STR or _TXT
D. _CHAR or _WIDE
Correct Answer: A
Chapter: 16
Q380:
Why should generic code be written instead of ASCII code in latest Windows APIs?
A. To support older software
B. Because Unicode is deprecated
C. Because most APIs expect Unicode
D. To reduce memory usage
Correct Answer: C

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now