Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q161: What will be the output of the REPLACE function if TEXT = "A(I,J) = A(I,J) + 3"?
- A: A(I,J) = A(I,J) + 3
- B: A = A + 3
- C: A(I,J) = A(I,J) + <>
- D: A = A + <>
View Answer
B
Q162: In SNOBOL, what data type can an array hold?
- A: Only strings
- B: Only integers
- C: Multiple data types
- D: Only floating point numbers
View Answer
C
Q163: What is the result of the statement "V = ARRAY(10, 1.0)" in SNOBOL?
- A: Creates an empty array
- B: Creates a 1-dimensional array of 10 elements with 1.0 as initial value
- C: Creates a 2-dimensional array
- D: Initializes an array with random values
View Answer
B
Q164: Which of the following best describes the use of the unary operator '$' in SNOBOL?
- A: It performs a calculation
- B: It references a memory address
- C: It assigns a variable value
- D: It uses a variable as the name of another variable
View Answer
D
Q165: What happens when an array index exceeds the defined range in SNOBOL?
- A: An error occurs
- B: The array index is reset to 0
- C: The program stops execution
- D: The control jumps to a label
View Answer
A
Q166: What does the command "N = ARRAY('3,5')" do in SNOBOL?
- A: Creates a 3x5 matrix
- B: Creates a 3-dimensional array
- C: Creates a 2x5 array initialized to NULL
- D: Creates a 1-dimensional array
View Answer
C
Q167: What type of functions does SNOBOL 4 support?
- A: Built-in functions only
- B: User-defined functions only
- C: Both built-in and user-defined functions
- D: No functions are supported
View Answer
C
Q168: What is the output of the following code: "RUN = 10; WORD = 'RUN'; $(WORD) = $(WORD) + 1"?
- A: RUN = 11
- B: WORD = 11
- C: RUN = RUN + 1
- D: WORD = 'RUN+1'
View Answer
A
Q169: How does SNOBOL handle arrays differently from most languages?
- A: All elements must be of the same type
- B: Each element can be of a different type
- C: Arrays cannot be dynamically sized
- D: Arrays are fixed in size
View Answer
B
Q170: What does the ARRAY function in SNOBOL return?
- A: A string
- B: A number
- C: An array with specified values
- D: A pointer to the array
View Answer
C