Vidyalelo
Computer Science · Q14

Artificial Intelligence

Engineering and GATE · Computer Science · question 14

Q14

In LISP, the addition 3 + 2 is entered as

A.
3 + 2
B.
3 add 2
C.
3 + 2 =
D.
(+ 3 2)
Answer
E.
None of the above

Answer: Option D

Solution

Answer: Option D
Solution:
In LISP, mathematical operations are typically written in prefix notation, where the operator precedes its operands within parentheses.
So, the addition of 3 and 2 is represented as (+ 3 2).
Options A, B, and C do not follow the syntax of LISP for arithmetic operations.
Therefore, the correct LISP notation for the addition 3 + 2 is Option D: (+ 3 2).