Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Multiple Choice Questions

Q3981: Which handle is assigned to `startInfoCh1.hStdOutput`?
  • A: GetStdHandle(STD_OUTPUT_HANDLE)
  • B: hReadPipe
  • C: hWritePipe
  • D: GetStdHandle(STD_INPUT_HANDLE)
View Answer
C

Q3982: What happens if CreatePipe() fails?
  • A: The program prints success
  • B: The program continues without a pipe
  • C: A report error function is called
  • D: The process halts silently
View Answer
C

Q3983: The purpose of CloseHandle() after creating a process is to
  • A: close unnecessary handles
  • B: save memory
  • C: prevent memory leaks
  • D: release system resources
View Answer
D

Q3984: The command line argument `targv` holds
  • A: the full path of command1
  • B: and command2
  • C: pipe handles
  • D: second command
View Answer
A

Q3985: What ensures that the pipe handles are inherited by the child process?
  • A: Inheritable flag set to TRUE
  • B: Inheritable flag set to FALSE
  • C: Using global variables
  • D: No security attributes provided
View Answer
A

Q3986: Which function waits until the specified process finishes execution?
  • A: WaitForFinish()
  • B: WaitForExit()
  • C: WaitForSingleObject()
  • D: WaitForProcess()
View Answer
C

Q3987: Command1 receives input through
  • A: standard input redirected to pipe
  • B: standard output redirected to pipe
  • C: standard input from keyboard
  • D: file stream
View Answer
A

Q3988: Command2 receives its output through
  • A: standard output
  • B: standard input
  • C: standard error redirected
  • D: standard output redirected to file
View Answer
A

Q3989: GetStdHandle(STD_INPUT_HANDLE) returns
  • A: the standard input handle
  • B: the standard output handle
  • C: the pipe handle
  • D: the process handle
View Answer
A

Q3990: If GetCommandLine() returns NULL, the program
  • A: calls ReportError
  • B: executes default commands
  • C: restarts the system
  • D: returns 1
View Answer
A

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now