Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q371: What does the member function return if the symbol is not found?
- A: NIL
- B: The original list
- C: Error
- D: NULL
View Answer
A
Q372: Which LISP function computes the intersection of two lists?
- A: member
- B: cond
- C: intersection
- D: union
View Answer
C
Q373: Which clause is required in a cond statement to act as default?
- A: eq
- B: NIL
- C: T
- D: None
View Answer
C
Q374: Recursion in LISP stops when ______ is met.
- A: Global variable is set
- B: A base case is met
- C: The function fails
- D: A default case is called
View Answer
B
Q375: Fill in the blank: The syntax for defining a function in LISP is (defun func-name (args) ______ ).
- A: Function body
- B: Parameters
- C: Variables
- D: Return value
View Answer
A
Q376: What is the output of (intersection '(a b c) '(b c d))?
- A: (a b)
- B: (b c)
- C: (c d)
- D: (a c)
View Answer
B
Q377: What does the intersection function in LISP return?
- A: Common elements of two lists
- B: A unique union of two lists
- C: All elements from the first list
- D: A reversed list
View Answer
A
Q378: In LISP, what does the set-difference function compute?
- A: Common elements of two lists
- B: Difference of two sets
- C: Total number of elements
- D: Intersection of two sets
View Answer
B
Q379: What is the purpose of the dotimes function in LISP?
- A: Execute a loop for a fixed number of times
- B: Find duplicates in a list
- C: Compute a recursive function
- D: Count list elements dynamically
View Answer
A
Q380: In the dolist function, what does the variable x represent?
- A: Index of an element
- B: An element of the list
- C: The length of the list
- D: The result of the loop
View Answer
B