What is the output of the given statement?
* (setf toss ‘(heads tails tails tails heads tails))
* (delete ‘heads toss)
* toss
a) Heads tails
b) Heads tails tails tails tails
c) Heads
d) None of the mentioned



What is the output of the given statement? * (setf toss ‘(heads tails tails tails heads tails..

Answer / chaitanya

b

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

 What is the process of creating new data types in lisp? a) List b) Structures c) Procedures d) None of the mentioned

1 Answers  


Demonstrate with an example how you can code in LISP?

1 Answers  


Explain what is List structures in Prolog?

1 Answers  


 What is the output of the given statement? * (defun when-plusp-with-bug (number result); (when (plusp number) result)); * (setf pressure -2) * (when-plusp-with-bug pressure (print ‘alarm)) a) Alarm b) Nil c) Both a & b d) None of the mentioned

1 Answers  


Explain what is the difference between bagof/3 and setof/3 predicate in Prolog?

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  


 What is the output of the given statement  in LISP? * (setf part (make-array ‘(8 8))) a) 8 b) 0 0 0 0 0 0 0 0 c) 0 0 0 0 d) 8 rows of 0

1 Answers  


 What is the output of the given statement? * (defstruct triangle (base 0) (altitude 0)) * (defun area (figure) (cond ((triangle-p figure) (* 1/2 (triangle-base figure) (triangle-altitude figure))))) * (setf triangle (make-triangle :base 2 :altitude 3)) * (area triangle) a) Triangle b) 7 c) 6 d) 10

1 Answers  


 What is the output of the following statement? *(setf thing ‘sphere r 1) * (cond ((eq thing ‘circle) (* pi r r)) ((* 4 pi r r))) a) 10.566 b) 11.5683 c) 12.56637 d) 13

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  


Mention what is the difference between Prolog and normal programming language?

1 Answers  


 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

1 Answers  


Categories