Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 9
Q141:
In SNOBOL, which operator is used for string concatenation?
A. +
B. Space
C. &
D. Period
Correct Answer: B
Chapter: 9
Q142:
If ROW = 'K' and NO. = 22, what will be the value of SEAT in SEAT = ROW NO.?
A. K22
B. K 22
C. K.22
D. K_22
Correct Answer: A
Chapter: 9
Q143:
What is the result of 2 ** 3 ** 2 in SNOBOL?
A. 64
B. 512
C. 128
D. 729
Correct Answer: B
Chapter: 9
Q144:
In SNOBOL, which of the following statements is used for altering the flow of control?
A. Loop statement
B. GOTO field
C. While loop
D. If-Else
Correct Answer: B
Chapter: 9
Q145:
What happens if a string can be interpreted as a number in a SNOBOL expression?
A. It’s converted to uppercase
B. It’s converted to numeric value
C. It’s ignored
D. It causes an error
Correct Answer: B
Chapter: 9
Q146:
What will the value of x be in x = 5 * -z + '10.6' if z = '10'?
A. -39.4
B. -50.6
C. 15.6
D. -45.4
Correct Answer: A
Chapter: 10
Q147:
What does the space symbol do in SNOBOL when used in concatenation and pattern matching?
A. Pattern matching
B. Concatenation
C. Both concatenation and pattern matching
D. None of the above
Correct Answer: C
Chapter: 10
Q148:
In SNOBOL, what does the replacement statement do?
A. Replaces characters in a string
B. Deletes a string
C. Assigns values to variables
D. It performs pattern matching only
Correct Answer: A
Chapter: 10
Q149:
What is the result of the replacement operation: SENTENCE = 'THIS IS YOUR PEN', SENTENCE 'YOUR' = 'MY'?
A. 'THIS IS MY PEN'
B. 'THIS IS YOUR PEN'
C. 'THIS IS MY YOUR PEN'
D. 'THIS IS PEN'
Correct Answer: A
Chapter: 10
Q150:
What is the output of the operation: TEXT = 'THIS IS AN INTEGER', TEXT KEYWORD =?
A. 'THIS IS INTEGER'
B. 'THIS IS CHAR'
C. 'THIS IS AN'
D. 'THIS IS'
Correct Answer: A
Chapter: 10
Q151:
What happens when an unsuccessful pattern match occurs using the '.' (dot) operator in SNOBOL?
A. The pattern is skipped
B. The matching substring is assigned to a variable
C. The entire string is assigned to a variable
D. Nothing happens
Correct Answer: B
Chapter: 10
Q152:
In SNOBOL, which operator is used for immediate value assignment, even if the entire pattern does not match?
A. $
B. .
C. ;
D. =
Correct Answer: A
Chapter: 10
Q153:
What is the function of the dot operator (.) in SNOBOL?
A. It concatenates strings
B. It assigns values based on successful pattern matches
C. It assigns values immediately
D. It skips unmatched patterns
Correct Answer: B
Chapter: 10
Q154:
What is the correct sequence for building a pattern in SNOBOL?
A. Concatenation followed by alternation
B. Alternation followed by concatenation
C. Either alternation or concatenation
D. Only concatenation
Correct Answer: B
Chapter: 10
Q155:
What does the following SNOBOL pattern match: BR = (‘B’
A. ‘R’) (‘E’
B. ‘EA’) (‘D’
C. ‘DS’)
D. BED, BEDS, BEAD, BEADS, RED, REDS, READ, READS
Correct Answer: A
Chapter: 10
Q156:
In SNOBOL, which of the following is an example of an immediate value assignment?
A. 'BREAD' BR
B. 'BREADS' BR
C. ‘TEXT’ KEYWORD
D. 'CHAR' TEXT
Correct Answer: A
Chapter: 11
Q157:
What does control flow in SNOBOL allow?
A. Sequential execution
B. Looping through input
C. Conditional execution
D. Indirect reference
Correct Answer: B
Chapter: 11
Q158:
What does the 'go to' field do in SNOBOL control flow?
A. Stops the program
B. Redirects execution to a label
C. Directly calls a function
D. Creates a new variable
Correct Answer: B
Chapter: 11
Q159:
Which of the following statements about indirect reference in SNOBOL is correct?
A. It directly accesses a variable
B. It uses the value of a variable as another variable
C. It stores the reference value in the variable
D. It initializes a variable
Correct Answer: B
Chapter: 11
Q160:
What does the SIZE function in SNOBOL return?
A. Number of words
B. Length of a string
C. Size of an array
D. Number of characters in a file
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now