Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q171: In SNOBOL, what will happen if an array index exceeds the array size during runtime?
- A: The program will crash
- B: Nothing will happen
- C: The control will jump to a label
- D: The array will be resized
View Answer
C
Q172: What does the 'BREAK' function do in SNOBOL?
- A: It breaks the execution loop
- B: It marks the start of a string
- C: It searches for a pattern in a string
- D: It splits the string into words
View Answer
C
Q173: What is the purpose of the SPAN function in SNOBOL?
- A: It scans the subject for digits
- B: It moves the cursor through a string
- C: It checks for word length
- D: It splits the string into segments
View Answer
B
Q174: How does the program in SNOBOL count occurrences of words of lengths between 3 and 9?
- A: It uses a fixed size array
- B: It reads lines from input and stores word lengths
- C: It creates an array and increments the value at each index
- D: It calculates word length based on sentence structure
View Answer
C
Q175: What does the "TABLE()" function create in SNOBOL?
- A: A table with unspecified length
- B: A predefined array
- C: A record type object
- D: A fixed-length array
View Answer
A
Q176: In SNOBOL, which data structure is indexed by a key value rather than an index number?
- A: Array
- B: Table
- C: Record
- D: String
View Answer
B
Q177: What does the operator "T<'A'> = 1" in SNOBOL do?
- A: Associates 'A' with value 1
- B: Creates an empty table
- C: Adds 'A' to an array
- D: Assigns value to a string
View Answer
A
Q178: Which of the following is a feature of SNOBOL?
- A: Static typing
- B: Lack of string operations
- C: Dynamic typing
- D: Limited string operations
View Answer
C
Q179: What is a limitation of SNOBOL mentioned in the content?
- A: Lack of variable length strings
- B: Complicated array syntax
- C: Poor documentation
- D: No operator overloading
View Answer
C
Q180: SNOBOL allows mixing _______ operations with string operations.
- A: Only string
- B: Only arithmetic
- C: Both arithmetic and string
- D: Only boolean
View Answer
C