Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q311: What is the purpose of the PUSH procedure in the STACK package?
- A: Remove an item from the stack
- B: Add an item to the stack
- C: Clear the stack
- D: Sort the stack
View Answer
B
Q312: What is a "tagged type" in Ada?
- A: A private type
- B: A dynamic type
- C: An extensible type
- D: A constant
View Answer
C
Q313: Which construct in Ada allows the initiation of parallel tasks?
- A: Package
- B: Tasking
- C: Exception handling
- D: Generic
View Answer
B
Q314: Generics in Ada are similar to what feature in C++?
- A: Macros
- B: Templates
- C: Functions
- D: Classes
View Answer
B
Q315: What is the output of the POP function in the STACK package?
- A: The number of items in the stack
- B: The top item in the stack
- C: The maximum size of the stack
- D: A sorted stack
View Answer
B
Q316: In Ada, where can an exception-handling code be placed?
- A: After the end statement of a block
- B: Within a procedure
- C: Before a package declaration
- D: After a function call
View Answer
A
Q317: What does the tasking mechanism in Ada enable?
- A: Sequential execution
- B: Concurrent execution
- C: Exception handling
- D: Error logging
View Answer
B
Q318: Fill in the blank: The statement used to explicitly raise an exception in Ada is ________.
- A: throw
- B: raise
- C: raise_exception
- D: throw_error
View Answer
B
Q319: Fill in the blank: In Ada, a tagged type is similar to a ________ in object-oriented programming.
- A: class
- B: function
- C: constant
- D: package
View Answer
A
Q320: Fill in the blank: The return statement in a function allows the function to _________.
- A: exit
- B: return a value
- C: raise an exception
- D: loop over variables
View Answer
B