What is the output of (/ 6 3) and (- 6 4)?
2 2
1/2 2
2 -2
1/2 -2
Answer and 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
ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
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
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
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
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
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
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
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
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
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
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
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?
$
&
Lisp displays a prompt to to tell that it waiting for something to enter.