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



 What is the output of the given statement? * (defstruct triangle (base 0) (altitude 0)) * (d..

Answer / chaitanya

c

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AI Languages Interview Questions

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

1 Answers  


 What is the output of the following statement? * ( first (rest (first ‘((a b) (c d))))) a) a b) b c) c d) d

1 Answers  


Which keyword is used to define macro procedures in LISP? a) Defun b) Demacro c) Defmacro 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))) * (defun book-author-writer (book author) (cons (list ‘author author) book)) a) Book b) Book-author c) Book-author-writer d) None of the mentioned

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  






Mention what are the three functions required by LISP?

1 Answers  


 What is partly embedded in the knowledge of your programming for manipulating applications? a) Programming cliches b) Procedures c) Abstraction d) Data

1 Answers  


 How data types are categorized in LISP?

1 Answers  


 In “cuts” what is the Parent goal in Prolog?

1 Answers  


Mention why you have to use “is” instead of “=” in Prolog when it comes to applying calculation logic?

1 Answers  


 What is the output of the following statement? * (first ‘( p h w)) a) P b) H c) W d) phw

1 Answers  


 What is the output of the given statement? * (setf day-or-date ‘monday) * (if (symbolp day-or-date) ‘day ‘date) a) Monday b) Day c) Date d) None of the mentioned

1 Answers  


Categories