System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q271: The source file is opened using which flag in CreateFile()?
- A: CREATE_ALWAYS
- B: OPEN_EXISTING
- C: OPEN_ALWAYS
- D: READ_ONLY
View Answer
B
Q272: To convert command line string to wide string, the function used is
- A: strconv()
- B: StringToWideChar()
- C: MultiByteToWideChar()
- D: WideCharToMultiByte()
View Answer
C
Q273: If CreateFile fails, which function provides the error code?
- A: GetError()
- B: LastError()
- C: GetLastError()
- D: ReportError()
View Answer
C
Q274: The input file is read using which buffer?
- A: inputBuffer[]
- B: CHAR buffer[]
- C: ReadData[]
- D: lpBuffer[]
View Answer
B
Q275: Which value is returned if the program usage is incorrect?
- A: 2
- B: 4
- C: 3
- D: 1
View Answer
D
Q276: The loop for copying continues until
- A: ReadFile returns 0
- B: All bytes are read
- C: All lines are read
- D: WriteFile fails
View Answer
A
Q277: Which Windows API function simplifies the file copy process?
- A: CopyFile()
- B: WriteFile()
- C: ReadFile()
- D: fcopy()
View Answer
A
Q278: What is the main benefit of using Windows Convenience Functions?
- A: They increase security
- B: They reduce file size
- C: They combine multiple operations into one function
- D: They compile code faster
View Answer
C
Q279: The function CopyFile() replaces which operations?
- A: Reading only
- B: Writing only
- C: Creating, opening, reading and writing
- D: Deleting files
View Answer
C
Q280: What is the correct number of command-line arguments required in this program?
- A: 1
- B: 2
- C: 3
- D: 4
View Answer
C