What is the output of the following statement?
* (defun both-ends-with-special ()(setf whole-list (cons (first whole-list) (last whole-list))))
* (setf whole-list ‘(monday tuesday wednesday thursday friday))
* (both-ends-with-special)
a) Monday
b) Friday
c) Wednesday
d) Both a & b



 What is the output of the following statement? * (defun both-ends-with-special ()(setf whole-..

Answer / chaitanya

d

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

 What is the output of the given statement? * (defclass article() ((title :accessor article-title :initarg :title) (author :accessor article-author :initarg :author))) a) Article b) c)  d) None of the mentioned

1 Answers  


What is the output of the given statement? * (defstruct person (sex nil) (personality ‘nice)) * (setf person-instance-1 (make-person)) * (setf person-instance-2 (make-person :sex ‘female)) a) Person :sex female :personality nice b) Person :sex c) Sex:Female d) None of the mentioned

1 Answers  


What is the output of the following statement? * (defun make (title author) (list (list ‘title title) (list ‘author author))) * (setf book (make ‘(Common Lisp) ‘(Guy steele))) a) Common Lisp b) Guy steele c) Make d) ((TITLE (COMMON LISP)) (AUTHOR (GUY STEELE)))

1 Answers  


Which is used to construct new lists by linking the right pointers? a) Links b) List c) Variables d) Right pointers

1 Answers  


 What is the output of the following statement? * ‘(first (first (rest (rest ((a b) (c d) (e f)))))) a) a b) b c) ab d) (FIRST (FIRST (REST (REST ((A B) (C D) (E F))))))

1 Answers  






 Which process helps to build large and complicated programs in LISP? a) Macros b) Procedure abstraction c) Defun d) None 

1 Answers  


What is the output of the given statement in LISP? * (setf abc ‘(a b c) xyz ‘(x y z)) * abc a) A b) B c) ABC

1 Answers  


What is the general pattern that shows how the various parts of an expression fit together? a) Template b) Pattern c) Match d) Both a & b

2 Answers  


Which is used to represent the prompt in lisp? a) # b) $ c) & d) *

1 Answers  


. What is the output of the given statement? * (setf high 98 temperature 102) * (when (> temperature high) (setf high temperature) ‘new-record) * high a) 98 b) 102 c) new d) Error

1 Answers  


 Which notation facilitates uniformity in lisp? a) Prefix b) Postfix c) Infix d) None of the mentioned

1 Answers  


 What is the output of the given statement? * (defstruct circle (radius 0)) * (defun area (figure) (cond ((circle-p figure) (* pi (expt (circle-radius figure) 2))))) * (setf circle (make-circle :radius 11)) * (area circle) a) 44 b) 380 c) 382 d) 380.132

1 Answers  


Categories