What is the output of (/ 6 3) and (- 6 4)?
2 2
1/2 2
2 -2
1/2 -2
View Answer
Correct Answer: A — 2 2
Explanation:
Syntax of the LISP takes prefix expressions. So, 6/3=2 and 6-4=2 will be the outputs of the following statements.
Output: 2,2
11 practice sets · Page 1 of 1
What is the output of (/ 6 3) and (- 6 4)?
2 2
1/2 2
2 -2
1/2 -2
Correct Answer: A — 2 2
Explanation:
Syntax of the LISP takes prefix expressions. So, 6/3=2 and 6-4=2 will be the outputs of the following statements.
Output: 2,2
Are arithmetic operators primitives in LISP?
True
False
Correct Answer: A — True
Explanation:
Yes, the arithmetic operators are primitives in LISP programming language. For example: in (/ 3 3) / is a primitive.
Which primitive can be used to add an element to List?
delete
cons
cdr
write
Correct Answer: B — cons
Explanation:
Cons is the primitive used to add an element to list. Cons take two lists as an argument and merge them to form a new list.
Which primitive can be used to remove an element from List?
delete
cons
cdr
write
Correct Answer: A — delete
Explanation:
Delete is the primitive used to remove an element from list. The element to be removed is passed as an argument to delete primitive along with the list name from which element is to be deleted and delete will remove that element from list.
Which primitive can be used to create a list?
getf
setf
make
none of the mentioned
Correct Answer: B — setf
Explanation:
Setf is used to create the list. Getf is used to retrieve the data from list. Make is not a primitive in LISP.
Choose the correct option for the output when lower or upper-case arguments are given in LISP.
Same output
Different output
LISP does not support lower case
LISP does not support upper case
Correct Answer: A — Same output
Explanation:
LISP gives the same output for both the cases. In fact, LISP always gives output in upper case letters.
What is the general pattern that shows how the various parts of an expression fit together?
Template
Pattern
Match
Both Template & Pattern
Correct Answer: A — Template
Explanation:
Template describes what should appear in the position occupied.
What is the process of reserving a place in computer memory to store a value for a symbol?
Storing
Ranging
Binding
None of the mentioned
Correct Answer: C — Binding
Explanation:
Binding means that allotting a memory location to a variable and storing a value in it.
Which is a procedures supplied by user in terms of primitives?
Custom
User-defined
Definite
All of the mentioned
Correct Answer: B — User-defined
Explanation:
A procedures supplied by user in terms of lisp primitives is called user-defined procedure.
Which notation facilitates uniformity in lisp?
Prefix
Postfix
Infix
None of the mentioned
Correct Answer: A — Prefix
Explanation:
Because the procedure name is always in the same place, no matter how many arguments are involved.
Which is used to represent the prompt in lisp?
$
&
Correct Answer: D — *
Explanation:
Lisp displays a prompt to to tell that it waiting for something to enter.