In LISP, which of the following function assigns the value 10 to the symbol a? A. (setq a 10) B. (a = b) where b = 10 C. (a = 10) (d) (setq 10 a) D. None of the above E. None of the above

(setq a 10)
(a = b) where b = 10
(a = 10) (d) (setq 10 a)
None of the above E. None of the above

The correct answer is (a).

(a) (setq a 10) assigns the value 10 to the symbol a.

(b) (a = b) where b = 10 tests whether the value of a is equal to the value of b.

(c) (a = 10) tests whether the value of a is equal to 10.

(d) (setq 10 a) assigns the value 10 to the symbol a, but it does not test whether the value of a is already 10.

(e) None of the above.

Exit mobile version