What is the output of the following LISP program? [code](setf cricket '(bat ball racquet)) (write (delete 'racquet cricket))[/code]

Nam Lê

Member
What is the output of the following LISP program?
Code:
(setf cricket '(bat ball racquet))
(write (delete 'racquet cricket))
A. bat ball racquet
B. bat ball
C. racquet bat ball
D. racquet
 
Answer: b
Explanation: Delete is given racquet as an argument to delete it from list cricket. So, it will delete racquet from the list cricket to form a new list: bat ball.
Output: BAT BALL
 

Tìm kiếm

Back
Top