System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 23
Q481:
The program closes file handles using _______.
A. CloseFile
B. CloseHandle
C. DeleteFile
D. FreeHandle
Correct Answer:
B
Chapter: 23
Q482:
If encryption fails, the program calls the function ReportError with a _______ message.
A. Success
B. Error
C. Warning
D. Information
Correct Answer:
B
Chapter: 23
Q483:
The value of shift is converted to type _______ before usage in the encryption loop.
A. DWORD
B. BYTE
C. INT
D. CHAR
Correct Answer:
B
Chapter: 23
Q484:
The shift value in the program is passed as a _______ parameter from the command line.
A. String
B. DWORD
C. CHAR
D. BOOL
Correct Answer:
C
Chapter: 23
Q485:
The encryption algorithm here is a variant of Caesar Cipher adapted to work on _______.
A. Alphabets
B. ASCII characters
C. Binary data
D. Unicode characters
Correct Answer:
B
Chapter: 23
Q486:
The program expects exactly _______ command line arguments including program name.
A. 2
B. 3
C. 4
D. 5
Correct Answer:
C
Chapter: 23
Q487:
If the program is run without the correct number of arguments, it displays a _______.
A. Help message
B. Error message
C. Success message
D. Warning message
Correct Answer:
B
Chapter: 23
Q488:
Which function converts the shift parameter from string to integer?
A. atoi
B. _ttoi
C. strtol
D. strcmp
Correct Answer:
B
Chapter: 23
Q489:
What happens if CreateFile fails to open the output file?
A. Input file handle is closed and FALSE returned
B. Output file is created anyway
C. Error message is displayed
D. Program exits with success
Correct Answer:
A
Chapter: 24
Q490:
Which Windows API is used to delete a file?
A. DeleteFile
B. CopyFile
C. MoveFile
D. RemoveFile
Correct Answer:
A
Chapter: 24
Q491:
Which API is used to copy files in Windows?
A. CopyFile
B. MoveFile
C. DeleteFile
D. RenameFile
Correct Answer:
A
Chapter: 24
Q492:
The CopyFile API returns TRUE if the copy operation is _______.
A. started
B. aborted
C. successful
D. failed
Correct Answer:
C
Chapter: 24
Q493:
The third parameter in CopyFile API is used to
A. allow file rename
B. check file size
C. control overwriting
D. specify file path
Correct Answer:
C
Chapter: 24
Q494:
Which API is used to move files in Windows?
A. MoveFile
B. CopyFile
C. DeleteFile
D. TransferFile
Correct Answer:
A
Chapter: 24
Q495:
MoveFile fails if the new file name
A. contains spaces
B. is too long
C. already exists
D. is invalid
Correct Answer:
C
Chapter: 24
Q496:
Which API allows moving and overwriting files or directories?
A. MoveFileEx
B. DeleteFile
C. CopyFileEx
D. FileTransfer
Correct Answer:
B
Chapter: 24
Q497:
MoveFileEx can be used to move
A. only files
B. only folders
C. only executables
D. both files and directories
Correct Answer:
D
Chapter: 24
Q498:
To overwrite an existing file during move operation, use
A. MoveFile
B. CopyFile
C. MoveFileEx
D. DeleteFile
Correct Answer:
C
Chapter: 24
Q499:
Which API creates a hard link to a file?
A. CreateFile
B. CopyHardLink
C. LinkFile
D. MakeHardLink
Correct Answer:
B
Chapter: 24
Q500:
Hard links must exist on
A. the same network volume
B. different partitions
C. the same system volume
D. different disks
Correct Answer:
C