System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 12
Q321:
Which ASCII characters cannot be used in Windows file names?
A. Letters and digits
B. Control characters
C. Spaces and underscores
D. Numbers and letters
Correct Answer:
B
Chapter: 12
Q322:
Which of the following symbols is NOT allowed in Windows file names?
A. Underscore (_)
B. Colon (:)
C. Dash (-)
D. Period (.)
Correct Answer:
B
Chapter: 12
Q323:
File names and directory names in Windows are _______.
A. Case sensitive
B. Case insensitive
C. Always lowercase
D. Always uppercase
Correct Answer:
B
Chapter: 12
Q324:
The separator between a file name and its extension is _______.
A. Comma (,)
B. Semicolon (;)
C. Period (.)
D. Colon (:)
Correct Answer:
C
Chapter: 12
Q325:
The maximum length of a file name in Windows is _______ characters.
A. 31
B. 128
C. 255
D. 512
Correct Answer:
C
Chapter: 12
Q326:
The maximum length of a full path (including folders and file name) in Windows is _______ characters.
A. 128
B. 255
C. 260
D. 512
Correct Answer:
C
Chapter: 12
Q327:
File extensions typically take how many bytes in Windows?
A. 1–2
B. 2–4
C. 5–8
D. 8–12
Correct Answer:
B
Chapter: 12
Q328:
A single dot (.) in a path represents the _______.
A. Root directory
B. Parent directory
C. Current directory
D. Home directory
Correct Answer:
C
Chapter: 12
Q329:
Double dot (..) in a path means _______.
A. Current directory
B. Two steps back in directory
C. One step back in directory
D. Root directory
Correct Answer:
C
Chapter: 12
Q330:
Which of the following is a valid file name in Windows?
A. Report.docx
B. Report|docx
C. Report:docx
D. Report/docx
Correct Answer:
A
Chapter: 13
Q331:
What is the return type of the CreateFile() API in Windows?
A. INT
B. VOID
C. HANDLE
D. BOOL
Correct Answer:
C
Chapter: 13
Q332:
The CreateFile() API is used to _______.
A. Read or write to a file
B. Delete a file
C. Open or create a new file
D. Close a file
Correct Answer:
C
Chapter: 13
Q333:
The parameter lpFileName in CreateFile() API points to the _______.
A. File size
B. File name
C. File attributes
D. File handle
Correct Answer:
B
Chapter: 13
Q334:
The dwDesiredAccess parameter specifies _______.
A. File creation mode
B. Access mode (read/write)
C. File sharing mode
D. File attributes
Correct Answer:
B
Chapter: 13
Q335:
If dwShareMode is set to 0, it means the file will be _______.
A. Shared for reading
B. Shared for writing
C. Not shared
D. Shared for read and write
Correct Answer:
C
Chapter: 13
Q336:
Which dwShareMode value allows a file to be shared for concurrent reading?
A. FILE_SHARE_WRITE
B. FILE_SHARE_READ
C. FILE_SHARE_EXECUTE
D. CREATE_NEW
Correct Answer:
B
Chapter: 13
Q337:
CREATE_NEW in the dwCreate parameter means _______.
A. Create a new file or overwrite
B. Create a new file, fail if exists
C. Open an existing file
D. Open or create a file
Correct Answer:
B
Chapter: 13
Q338:
CREATE_ALWAYS in the dwCreate parameter will _______.
A. Create new file, fail if exists
B. Create new file or overwrite existing file
C. Open existing file only
D. Open or create a file
Correct Answer:
D
Chapter: 13
Q339:
OPEN_EXISTING in the dwCreate parameter _______.
A. Always creates a new file
B. Opens an existing file or fails if file not found
C. Always overwrites the file
D. Allows shared access
Correct Answer:
B
Chapter: 13
Q340:
OPEN_ALWAYS in the dwCreate parameter will _______.
A. Only open existing file
B. Open existing file or create if not exists
C. Always create new file
D. Always fail if file exists
Correct Answer:
B