System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q251: Which Windows function is used to open a file for reading?
- A: fopen()
- B: ReadFile()
- C: CreateFile()
- D: OpenFile()
View Answer
C
Q252: Which function is used to convert ASCII to Unicode in the program?
- A: WideCharToMultiByte()
- B: MultiByteToWideChar()
- C: StringToUnicode()
- D: AsciiToUnicode()
View Answer
B
Q253: The Windows API data type used to define a file handle is
- A: DWORD
- B: CHAR
- C: HANDLE
- D: INT
View Answer
C
Q254: Which value of `argc` indicates correct command-line input for this program?
- A: 2
- B: 3
- C: 1
- D: 4
View Answer
B
Q255: The buffer size defined in the program is
- A: 256 bytes
- B: 8192 bytes
- C: 16384 bytes
- D: 1024 bytes
View Answer
C
Q256: What does the constant `GENERIC_READ` signify in CreateFile()?
- A: File will be deleted
- B: File will be copied
- C: File will be read
- D: File will be opened for editing
View Answer
C
Q257: The destination file is created using which flag in CreateFile()?
- A: OPEN_EXISTING
- B: CREATE_NEW
- C: APPEND_ALWAYS
- D: CREATE_ALWAYS
View Answer
D
Q258: Which function is used to read from a file in this Windows API program?
- A: fread()
- B: ReadFile()
- C: InputStream()
- D: read()
View Answer
B
Q259: In this program, which function is used to write to a file?
- A: fwrite()
- B: WriteFile()
- C: output()
- D: SendFile()
View Answer
B
Q260: If the source file fails to open, what value is returned?
- A: 1
- B: 3
- C: 2
- D: 4
View Answer
C