Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
nmims post
Objective Type Set
Online MCQ Assignment
Question Solution
Solved Question
Uncategorized

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

View Answer

Answer: d [Reason:] Lisp displays a prompt to to tell that it waiting for something to enter.

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

View Answer

Answer: a [Reason:] Because the procedure name is always in the same place, no matter how many arguments are involved.

3. Which is a procedures supplied by user in terms of primitives?
a) Custom
b) User-defined
c) Definite
d) All of the mentioned

View Answer

Answer: b [Reason:] A procedures supplied by user in terms of lisp primitives is called user-defined procedure.

4. What is the process of reserving a place in computer memory to store a value for a symbol?
a) Storing
b) Ranging
c) Binding
d) None of the mentioned

View Answer

Answer: c [Reason:] None

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

View Answer

Answer: a [Reason:] Template describes what should appear in the position occupied.

6. What is the output of the following statement?

span class="sy0"> * (+ 3.14 2.71)

a) 3.14
b) 2.71
c) 5.84
d) 5.85

View Answer

Answer: c [Reason:] This statement is used to add the two given values. Output: 5.84

7. What is the output of the following statement?

span class="sy0"> * (first '( p h w))

a) P
b) H
c) W
d) phw

View Answer

Answer: a [Reason:] This statement will print the first alphabet of the given value. Output: P

8. What is the output of the following statement?

span class="sy0"> * ( first (rest (first '((a b) (c d)))))

a) a
b) b
c) c
d) d

View Answer

Answer: b [Reason:] This statement is used to print b because of nesting. Output: b

9. What is the output of the following statement?

span class="sy0"> * '(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))))))

View Answer

Answer: d [Reason:] Because ‘ character is recognized as a macro character, so it will convert ‘ into (quote ). Output: (FIRST (FIRST (REST (REST ((A B) (C D) (E F))))))

10. What is the output of the following statement?

span class="sy0"> * (cdr '(a b c))

a) a
b) B
c) (B C)
D) None of the mentioned

View Answer

Answer: c [Reason:] cdr function is used to form composite primitives. Output: (B C)