Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q301: The Ada assignment operator is:
- A: =
- B: :=
- C: ==
- D: =>
View Answer
B
Q302: Fill in the blank: The Ada "exit" statement is used to ________.
- A: Exit a loop
- B: Exit a function
- C: Exit a program
- D: Exit a block
View Answer
A
Q303: In Ada, what is used to access individual fields in a record?
- A: ->
- B: .
- C: ::
- D: #
View Answer
B
Q304: What happens if an Ada "case" statement has no match for the expression?
- A: Nothing happens
- B: An exception is raised at compile time
- C: An exception is raised at runtime
- D: The program stops
View Answer
B
Q305: What is the primary purpose of the return statement in a function?
- A: To raise an exception
- B: To exit a loop
- C: To return a value
- D: To define a new variable
View Answer
C
Q306: In Ada, which statement is used to raise an exception?
- A: raise
- B: throw
- C: catch
- D: raise_exception
View Answer
A
Q307: What must a function in Ada have at least one of?
- A: Variable
- B: Exception
- C: Return statement
- D: Parameter
View Answer
C
Q308: How are exceptions declared in Ada?
- A: Like procedures
- B: Like variables
- C: Like constants
- D: Like types
View Answer
B
Q309: In Ada, exception-handling code is written at the end of a ________.
- A: for loop
- B: block
- C: procedure
- D: function
View Answer
B
Q310: Which part of an Ada package typically defines its public interface?
- A: Package body
- B: Package specification
- C: Package implementation
- D: Package footer
View Answer
B