Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Multiple Choice Questions

Q431: Which API function is used to get a handle to a standard IO device?
  • A: GetStdHandle()
  • B: SetStdHandle()
  • C: CloseHandle()
  • D: OpenHandle()
View Answer
A

Q432: What does GetStdHandle() return if the function fails?
  • A: NULL
  • B: INVALID_HANDLE_VALUE
  • C: -1
  • D: 0
View Answer
B

Q433: If a handle is closed, it becomes _______ for the process.
  • A: usable
  • B: locked
  • C: unusable
  • D: duplicated
View Answer
C

Q434: Which of the following is a valid value for the nStdHandle parameter?
  • A: STD_INPUT_HANDLE
  • B: STD_FILE_HANDLE
  • C: STD_NETWORK_HANDLE
  • D: STD_SOCKET_HANDLE
View Answer
A

Q435: STD_OUTPUT_HANDLE corresponds to which environment variable?
  • A: CONIN$
  • B: CONOUT$
  • C: STDOUT$
  • D: STDERR$
View Answer
B

Q436: SetStdHandle() is used for ________ of standard IO handles.
  • A: closing
  • B: creating
  • C: duplicating
  • D: redirecting
View Answer
D

Q437: The default standard error device is associated with _______.
  • A: Console
  • B: Output file
  • C: Error log
  • D: Input device
View Answer
C

Q438: If GetStdHandle(STD_INPUT_HANDLE) succeeds, it returns a ______.
  • A: 1
  • B: handle
  • C: NULL
  • D:
View Answer
B

Q439: Standard IO handles are used to manipulate IO devices in the _______ environment.
  • A: Windows
  • B: Linux
  • C: Unix
  • D: DOS
View Answer
A

Q440: Which data type is passed as the second parameter to SetStdHandle()?
  • A: DWORD
  • B: HANDLE
  • C: BOOL
  • D: int
View Answer
B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now