Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Chapter: 17
Q321:
Fill in the blank: Packages in Ada typically consist of ________ and ________.
A. headers and bodies
B. functions and procedures
C. specifications and bodies
D. variables and constants
Correct Answer:
C
Chapter: 18
Q322:
What does LISP stand for?
A. List Processor
B. Logical Input System
C. Linear Symbol Processing
D. List Iterative Symbol Protocol
Correct Answer:
A
Chapter: 18
Q323:
Who invented LISP?
A. Alan Turing
B. John McCarthy
C. Dennis Ritchie
D. Guido van Rossum
Correct Answer:
B
Chapter: 18
Q324:
Which data structures are used heavily in LISP?
A. Arrays
B. Atoms and lists
C. Trees
D. Hash tables
Correct Answer:
B
Chapter: 18
Q325:
In which year was LISP invented?
A. 1945
B. 1958
C. 1972
D. 1980
Correct Answer:
B
Chapter: 18
Q326:
The two most popular versions of LISP are ______.
A. Scheme and Common Lisp
B. Python and Perl
C. Java and JavaScript
D. Prolog and Fortran
Correct Answer:
A
Chapter: 18
Q327:
What is an atom in LISP?
A. A sequence of numbers
B. A sequence of characters
C. A sequence of integers
D. A sequence of arrays
Correct Answer:
B
Chapter: 18
Q328:
Which of the following is a valid atom in LISP?
A. 12345
B. price-of-beef
C. "this is red"
D. All of the above
Correct Answer:
D
Chapter: 18
Q329:
The special symbols T and NIL in LISP represent _______.
A. Logical true and false
B. True and None
C. Boolean variables
D. List elements
Correct Answer:
A
Chapter: 18
Q330:
What does S in S-expression stand for in LISP?
A. Sequential
B. Symbolic
C. Structured
D. Special
Correct Answer:
B
Chapter: 18
Q331:
What type of notation does LISP use?
A. Infix notation
B. Prefix notation
C. Postfix notation
D. Cambridge notation
Correct Answer:
B
Chapter: 18
Q332:
What is the result of evaluating (+ 1 3 5) in LISP?
A. 8
B. 9
C. 7
D. Error
Correct Answer:
B
Chapter: 18
Q333:
Fill in the blank: An empty list in LISP is represented by _______.
A. nil
B. ()
C. both A and B
D. None
Correct Answer:
C
Chapter: 18
Q334:
What function is used to assign values to symbols in LISP?
A. assign
B. setq
C. alloc
D. map
Correct Answer:
B
Chapter: 18
Q335:
What will (setq x 3.0) return in LISP?
A. x
B. 3
C. Error
D. NIL
Correct Answer:
B
Chapter: 18
Q336:
In LISP, what happens when quote is used with a symbol?
A. The symbol is evaluated
B. The symbol is not evaluated
C. The symbol is multiplied by 2
D. The symbol is deleted
Correct Answer:
B
Chapter: 18
Q337:
What will (quote x) return in LISP?
A. x
B. Value of x
C. Error
D. NIL
Correct Answer:
A
Chapter: 18
Q338:
Evaluate: (+ (/ 3 5) 4)
A. 23/5
B. 4.6
C. Error
D. 0.6
Correct Answer:
A
Chapter: 18
Q339:
Which of the following is a top-level element in the list (a b (c d))?
A. a
B. (c d)
C. b
D. All of the above
Correct Answer:
D
Chapter: 18
Q340:
What type of programming paradigm does LISP follow?
A. Procedural
B. Functional
C. Object-Oriented
D. Declarative
Correct Answer:
B