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 bounded to a list of all unaccounted argument values?
a) REST
b) &REST
c) RAISE
d) &RAISE

View Answer

Answer: b [Reason:] A rest parameter will be marked by &REST and it is bounded to a list of all unaccounted argument values.

2. Which allow procedures to use themselves again?
a) Recursion
b) Reuse
c) Reintiate
d) None of the mentioned

View Answer

Answer: a [Reason:] Recursion allows procedures to use themselves again and again.

3. Which eliminate the need for many auxiliaries?
a) Parameters
b) Block parameters
c) Optional parameters
d) All of the mentioned

View Answer

Answer: c [Reason:] None.

4. Which can appear without an initial form?
a) Parameter
b) Block parameter
c) Optional parameter
d) Aux parameter

View Answer

Answer: d [Reason:] An aux parameter can appear without an initial form, in which case there are no surrounding parentheses.

5. What value will assigned, if there is no argument marked by a matching keyword?
a) T
b) NIL
c) False
d) Both NIL & False

View Answer

Answer: b [Reason:] If there is no argument marked by a matching keyword, the corresponding keyword parameter is bound to NIL.

6. What is the output of the following statement?

span class="sy0"> * (defun higher-level-expt (m n)(if (zerop n)1 (* m(lower-level-expt m (- n 1)))))

a) Higher
b) Higher-level-expt
c) Lower
d) Lower-level-expt

View Answer

Answer: b [Reason:] This statement will print higher-level-expt because it is defined atfirst. Output: HIGHER-LEVEL-EXPT

7. What is the output of the following statement?

span class="sy0"> * (defun root (x &optional n) (if n (expt x (/ 1 n))(sprt x)))
* (root 27 3)

a) 3
b) 27
c) 3.0
d) None of the mentioned

View Answer

Answer: c [Reason:] This statement is used to find out the square root of the given value. Output: 3.0

8. What is the output of the following statement?

span class="sy0"> * (defun punc (l) (append l '(period)))
* (punc '(this))

a) This
b) Period
c) This period
d) All of the mentioned

View Answer

Answer: c [Reason:] This statement will append the period to the end of the given statement. Output: (THIS PERIOD)

9. What is the output of the following statement?

span class="sy0"> * (defun raise-aux (result number-list)(if (endp number-list) result (raise-aux (expt result (first number-list)) (rest number-list))))
* (defun raise (x &rest numbers) (raise-aux x numbers))
* (raise 5 3)

a) 5
b) 3
c) 125
d) 25

View Answer

Answer: c [Reason:] This statement will print the square of the given value. Output: 125

10. What is the output of the following statement?

span class="sy0"> *  (setf pairs '((maple shade) (apple fruit)))
* (member '(maple shade) '((maple shade) (maple shade)) :test-not #'equal)

a) Maple
b) Shade
c) Nil
d) T

View Answer

Answer: c [Reason:] This statement is used to test the given statement for its equality. Output: NIL