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 primitive is used to connect the files with the streams?
a) Read
b) Format
c) With-open-file
d) None of the mentioned

View Answer

Answer: c [Reason:] Streams are created, variables are bound to them and they are connected to files using with-open-file.

2. How many types of streams are available in lisp?
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: b [Reason:] There are two types of streams available in streams. They are input and output streams.

3. Which stream is involved with print and format forms?
a) Input
b) Output
c) Both Input & Output
d) None of the mentioned

View Answer

Answer: b [Reason:] Output streams are involved with print and format forms.

4. What will happen if nil is supplied as second argument in read form?
a) T
b) Value
c) Nil
d) None of the mentioned

View Answer

Answer: c [Reason:] None.

5. How many types of read forms are available in file manipulation?
a) 1
b) 2
c) 3
d) 4

View Answer

Answer: b [Reason:] The two types of read forms available in read form are read-line and read-char.

6. What is the output of the given statement?

span class="sy0"> * (read)(+ 2 2)
* (eval (read))(+ 2 2)

a) 2
b) 3
c) 4
d) Error

View Answer

Answer: c [Reason:] This statement will add up the given values and print out the result. Output: 4

7. What is the output of the given statement?

* (length '(a b c))
* (reverse '(a b c))

a) 3
b) C B A
c) A B C
d) Both 3 & C B A

View Answer

Answer: d [Reason:] First statement will print the length and second statement will reverse the string. Output: 3 (C B A)

8. What is the output of the given statement?

span class="sy0"> * (elt "stevejobs" 6)

a) o
b) e
c) #/o
d) None of the mentioned

View Answer

Answer: c [Reason:] This statement will print the sixth letter of the given string. Output: #/o

9. What is the output of the given statement?

span class="sy0"> * (read-line)This is a test.

a) This is a test.
b) Nil
c) Error
d) Both This is a test. & Nil

View Answer

Answer: d [Reason:] This statement will read the given line and print it. Output: “This is a test.” NIL

10. What is the output of the given statement?

span class="sy0"> * (search "boris" "katz, boris" :test #'char-equal)

a) Katz
b) Boris
c) 6
d) Error

View Answer

Answer: c [Reason:] This statement will search for the given string and print the result. Output: 6