Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Multiple Choice Questions

Q361: Which statement is used in LISP for conditional control?
  • A: while
  • B: if
  • C: when
  • D: for
View Answer
B

Q362: LISP functions return the value of the ______ in their body.
  • A: First expression
  • B: Last expression
  • C: Middle expression
  • D: All expressions
View Answer
B

Q363: The syntax (if <test> <then> <else>) is used for ______ in LISP.
  • A: Looping
  • B: Conditional branching
  • C: List creation
  • D: Recursion
View Answer
B

Q364: What is the output of (power 2 3) using the recursive function?
  • A: 6
  • B: 8
  • C: 4
  • D: 16
View Answer
B

Q365: What is the base case in the recursive member function?
  • A: List is empty
  • B: List has one element
  • C: x is not in list
  • D: None of these
View Answer
A

Q366: What will the function (length '(a b c)) return in LISP?
  • A: 3
  • B: 4
  • C: 0
  • D: Error
View Answer
A

Q367: In LISP, recursion is primarily used for ______.
  • A: List operations
  • B: Iteration
  • C: Boolean operations
  • D: Mathematical operations
View Answer
B

Q368: What does (cond (t 'default)) always return in LISP?
  • A: NIL
  • B: Error
  • C: The default value
  • D: True value
View Answer
C

Q369: The power function (defun power (x y) ...) computes ______.
  • A: Factorial
  • B: Exponentiation
  • C: Square root
  • D: Logarithm
View Answer
B

Q370: What will (if (= 1 1) 'true 'false) return in LISP?
  • A: NIL
  • B: 1
  • C:
  • D: Error
View Answer
B

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now