System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 101
Q2241:
The function WaitForSingleObject() is used here to ______.
A. wait for a thread to start
B. wait for process termination
C. wait for a file handle
D. wait for keyboard input
Correct Answer:
B
Chapter: 101
Q2242:
How does the program calculate elapsed process time?
A. exitTime - userTime
B. exitTime - createTime
C. kernelTime - userTime
D. createTime - exitTime
Correct Answer:
B
Chapter: 101
Q2243:
FILETIME is a union of LONGLONG and ______.
A. SYSTEMTIME
B. PROCESS_INFORMATION
C. FILETIME
D. HANDLE
Correct Answer:
C
Chapter: 101
Q2244:
The function FileTimeToSystemTime() converts ______ to SYSTEMTIME.
A. FILETIME
B. PROCESS_INFORMATION
C. OSVERSIONINFO
D. HANDLE
Correct Answer:
A
Chapter: 101
Q2245:
What kind of time does kernelTime represent in process timing?
A. Time spent in user mode
B. Time spent in kernel mode
C. Real elapsed time
D. Total CPU time
Correct Answer:
B
Chapter: 101
Q2246:
What does the program print with _tprintf related to process timing?
A. Real time, user time, and system time
B. CPU usage only
C. Memory usage
D. Thread count
Correct Answer:
A
Chapter: 101
Q2247:
The command-line argument count variable in the program is named ______.
A. argc
B. argv
C. targv
D. cLine
Correct Answer:
A
Chapter: 101
Q2248:
The program terminates with an error if the OS is not ______.
A. Windows 10
B. Windows 7
C. Windows NT kernel
D. Windows XP
Correct Answer:
C
Chapter: 101
Q2249:
What handle type is stored in procInfo.hProcess?
A. Thread handle
B. Process handle
C. File handle
D. Window handle
Correct Answer:
B
Chapter: 101
Q2250:
After process completion, which handles are closed by the program?
A. procInfo.hProcess only
B. procInfo.hThread only
C. procInfo.hThread and procInfo.hProcess
D. None
Correct Answer:
C
Chapter: 101
Q2251:
The main function type used in this program is named ______.
A. main
B. WinMain
C. _tmain
D. processMain
Correct Answer:
C
Chapter: 101
Q2252:
The variable elTiSys holds the ______ time converted from FILETIME.
A. elapsed
B. kernel
C. user
D. creation
Correct Answer:
A
Chapter: 102
Q2253:
Which function is used to get the full command line as a single string?
A. GetCommandLine()
B. CreateProcess()
C. SkipArg()
D. ReportError()
Correct Answer:
A
Chapter: 102
Q2254:
What is the purpose of the SkipArg() function in the code?
A. Skip past the executable name
B. Get OS version
C. Convert FILETIME
D. Start process
Correct Answer:
B
Chapter: 102
Q2255:
The program only runs on which Windows platform?
A. Windows 7
B. Windows NT kernels
C. Windows XP
D. Windows Vista
Correct Answer:
B
Chapter: 102
Q2256:
Which structure is used for file time arithmetic?
A. FILETIME
B. LONGLONG
C. STARTUPINFO
D. PROCESS_INFORMATION
Correct Answer:
B
Chapter: 102
Q2257:
Which function starts a new process?
A. CreateProcess()
B. GetProcessTimes()
C. GetCommandLine()
D. WaitForSingleObject()
Correct Answer:
A
Chapter: 102
Q2258:
What does GetProcessTimes() retrieve?
A. Process IDs
B. Process execution times
C. Process priorities
D. Handles
Correct Answer:
B
Chapter: 102
Q2259:
The variable 'hProc' stores the ____.
A. Process handle
B. Process ID
C. Thread ID
D. Process priority
Correct Answer:
A
Chapter: 102
Q2260:
What is the main role of WaitForSingleObject() here?
A. Wait for process to finish
B. Wait for user input
C. Wait for OS startup
D. Wait for thread start
Correct Answer:
A