Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
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
View Answer
B
Q152: In SNOBOL, which operator is used for immediate value assignment, even if the entire pattern does not match?
- A: $
- B: .
- C: ;
- D: =
View Answer
A
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
View Answer
B
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
View Answer
B
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
View Answer
A
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
View Answer
A
Q157: What does control flow in SNOBOL allow?
- A: Sequential execution
- B: Looping through input
- C: Conditional execution
- D: Indirect reference
View Answer
B
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
View Answer
B
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
View Answer
B
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
View Answer
B