System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 22
Q461:
The function _memtchr() is used to check if a character exists within a _______.
A. String
B. Buffer
C. Flag array
D. Pointer
Correct Answer:
A
Chapter: 22
Q462:
What is the return type of the Options() function?
A. DWORD
B. BOOL
C. VOID
D. INT
Correct Answer:
A
Chapter: 22
Q463:
In the Options() function, what type is the argv parameter?
A. LPCTSTR[]
B. LPBOOL[]
C. DWORD[]
D. CHAR[]
Correct Answer:
A
Chapter: 22
Q464:
Which function is called at the end of variable argument processing?
A. va_start
B. va_end
C. va_arg
D. va_copy
Correct Answer:
B
Chapter: 22
Q465:
What happens if the Options() function encounters an argument not starting with ‘-‘?
A. It is ignored
B. It is treated as a file name
C. It stops processing
D. It sets an error
Correct Answer:
C
Chapter: 22
Q466:
The CatFile function processes data in chunks of size _______.
A. BUF_SIZE
B. argc
C. DWORD
D. LPBOOL
Correct Answer:
A
Chapter: 22
Q467:
Which of the following is NOT true about the Options() function?
A. It uses variable argument lists
B. It parses command line options
C. It copies file content
D. It returns the argument index where parsing ended
Correct Answer:
C
Chapter: 23
Q468:
The Caesar Cipher replaces each alphabet with another alphabet placed ______ positions forward.
A. n
B. c
C. m
D. 26
Correct Answer:
A
Chapter: 23
Q469:
In Caesar Cipher, the text after encryption is called _______.
A. Plain text
B. Encrypted text
C. Cipher text
D. Decrypted text
Correct Answer:
C
Chapter: 23
Q470:
The original text before encryption is known as _______.
A. Cipher text
B. Plain text
C. Encrypted text
D. Decrypted text
Correct Answer:
B
Chapter: 23
Q471:
If n=1 in Caesar Cipher, 'Z' is replaced by _______.
A. A
B. Y
C. B
D. C
Correct Answer:
A
Chapter: 23
Q472:
The formula C = (P + n) mod 26 is used because there are ______ alphabets.
A. 128
B. 26
C. 256
D. 52
Correct Answer:
B
Chapter: 23
Q473:
When encrypting ASCII characters, the modulo used is _______.
A. 128
B. 26
C. 256
D. 52
Correct Answer:
C
Chapter: 23
Q474:
In ASCII-based Caesar Cipher, if P is the plain text byte and n is the shift, the cipher text C is calculated as _______.
A. (P - n) mod 256
B. (P + n) mod 256
C. (P * n) mod 256
D. (P / n) mod 256
Correct Answer:
B
Chapter: 23
Q475:
The encryption program uses which Windows API function to open the input file?
A. CreateFile
B. OpenFile
C. ReadFile
D. WriteFile
Correct Answer:
A
Chapter: 23
Q476:
Which flag is used in CreateFile to open a file for reading?
A. GENERIC_WRITE
B. GENERIC_READ
C. FILE_ATTRIBUTE_NORMAL
D. OPEN_EXISTING
Correct Answer:
B
Chapter: 23
Q477:
In the program, the variable bShift stores the _______.
A. Plain text
B. Shift amount
C. Buffer size
D. Output file handle
Correct Answer:
B
Chapter: 23
Q478:
The buffer array is used to store _______ during encryption.
A. Input file data
B. Output file data
C. Error messages
D. File names
Correct Answer:
A
Chapter: 23
Q479:
How is each byte of the buffer modified in the encryption loop?
A. It is multiplied by shift
B. It is subtracted by shift
C. It is added by shift
D. It is XORed with shift
Correct Answer:
C
Chapter: 23
Q480:
Which Windows API function writes encrypted data to the output file?
A. WriteFile
B. ReadFile
C. CreateFile
D. CloseHandle
Correct Answer:
A