Lisp Syntax MCQ Questions & Answers
This section focuses on "Syntax" of LISP programming language. These Multiple Choice Questions (MCQ) should be practiced to improve the LISP skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. How many basic building blocks LISP is made up of?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: LISP programs are made up of three basic building blocks : atom, list, string.
2. A list is a sequence of atoms and/or other lists enclosed in ?
A. {}
B. []
C. ()
D. ||
View Answer
Ans : C
Explanation: A list is a sequence of atoms and/or other lists enclosed in parentheses
3. A ________ is a group of characters enclosed in double quotation marks.
A. list
B. array
C. atom
D. string
View Answer
Ans : D
Explanation: A string is a group of characters enclosed in double quotation marks.
4. Which of the following is used for indicating a comment line?
A. "
B.
C. ;
D. #
View Answer
Ans : C
Explanation: The semicolon symbol (;) is used for indicating a comment line.
5. Which of the following is numeric operations in LISP?
A. -
B. *
C. /
D. All of the above
View Answer
Ans : D
Explanation: The basic numeric operations in LISP are +, -, *, and /
6. LISP expressions are case-insensitive?
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: True, LISP expressions are case-insensitive.
7. A Naming Conventions in LISP can have digit in it?
A. Yes
B. No
C. Can be yes or no
D. Can not say
View Answer
Ans : A
Explanation: A name can have digits but not entirely made of digits, because then it would be read as a number.
8. An _______ is a number or string of contiguous characters.
A. list
B. atom
C. array
D. None of the above
View Answer
Ans : B
Explanation: An atom is a number or string of contiguous characters.
9. Which of this is a correct syntax for defining a function in LISP?
A. (defun (tempfunc) (x) (+ x 1))
B. (define tempfunc (x) (+ x 1))
C. (defun tempfunc (x) (+ x 1))
D. (def tempfunc (x) (+ x 1))
View Answer
Ans : C
Explanation: (defun tempfunc (x) (+ x 1)) is a correct syntax for defining a function in LISP.
10. What does the cdr function return in LISP?
A. The first element of the list
B. The second element of the list
C. The list without the first element
D. The last element of the list
View Answer
Ans : C
Explanation: The cdr function return in LISP the list without the first element.
Discussion