Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 16
Q281:
In Ada, which of the following is used to exit a loop?
A. exit
B. continue
C. break
D. return
Correct Answer: A
Chapter: 16
Q282:
What is a characteristic of Ada's case statement?
A. Supports fall-through
B. Requires all values to be static
C. Requires dynamic values
D. None of the above
Correct Answer: B
Chapter: 16
Q283:
Which of the following is NOT a loop type in Ada?
A. While loop
B. Do-while loop
C. For loop
D. Simple loop
Correct Answer: B
Chapter: 16
Q284:
In Ada, which loop is used for potentially infinite loops?
A. Simple loop
B. While loop
C. For loop
D. Do-while loop
Correct Answer: A
Chapter: 16
Q285:
Which of the following loops is NOT supported in Ada?
A. While loop
B. For loop
C. Simple loop
D. Do-while loop
Correct Answer: D
Chapter: 16
Q286:
What is the range operator in Ada?
A. ..
B. :
C. =
D. ->
Correct Answer: A
Chapter: 16
Q287:
What does the "reverse" keyword in Ada’s for loop do?
A. It reverses the loop’s iteration order.
B. It sets a limit on the loop.
C. It stops the loop when the condition is met.
D. It does nothing.
Correct Answer: A
Chapter: 16
Q288:
Which of the following is true about Ada’s "while" loop?
A. It supports post-test loops like C.
B. The loop condition is checked after the loop body.
C. The loop condition is checked before the loop body.
D. The loop runs indefinitely.
Correct Answer: C
Chapter: 16
Q289:
In Ada, which statement is used to terminate a loop?
A. terminate
B. exit stop
C. halt
Correct Answer: B
Chapter: 16
Q290:
What does the "when others" clause in a case statement in Ada do?
A. Covers all values not mentioned in other when clauses
B. Stops the case statement from executing
C. Allows values to be dynamic
D. None of the above
Correct Answer: A
Chapter: 16
Q291:
In Ada, how are case statement choices specified?
A. By a range or discrete values
B. Only by discrete values
C. Only by ranges
D. By a combination of both ranges and values
Correct Answer: D
Chapter: 16
Q292:
What happens if a case expression does not match any of the choices in Ada?
A. An exception is raised at compile time
B. An exception is raised at runtime
C. Nothing happens
D. An error is printed
Correct Answer: B
Chapter: 16
Q293:
What is the default case used in Ada's case statement?
A. when others
B. when default
C. when else
D. when any
Correct Answer: A
Chapter: 16
Q294:
Which keyword is used to start the block section in Ada?
A. declare
B. begin
C. execute
D. loop
Correct Answer: B
Chapter: 16
Q295:
In Ada, which of the following is required in a case statement?
A. The expression must match one of the choices.
B. The expression can have any value.
C. The expression is optional.
D. No match is needed.
Correct Answer: A
Chapter: 16
Q296:
Can the value of the loop variable in Ada’s for loop be changed inside the loop body?
A. Yes
B. No
C. Maybe
D. Depends on the loop type
Correct Answer: B
Chapter: 16
Q297:
What does the Ada "exit when condition" statement do?
A. Exits the loop when the condition is false
B. Exits the loop based on a set condition
C. Exits the loop at any point
D. Exits the loop unconditionally
Correct Answer: B
Chapter: 16
Q298:
In Ada, which type of record is used like union types in C?
A. Discriminated records
B. Normal records
C. Array records
D. Access types
Correct Answer: A
Chapter: 16
Q299:
What is the main difference between Ada's discriminated records and C's union types?
A. Ada uses discriminants to specify the type of data currently stored.
B. C allows any type of data.
C. C has a fixed data type.
D. Ada does not support unions.
Correct Answer: A
Chapter: 16
Q300:
Which of the following is true about Ada's access types?
A. They are similar to pointers in C++
B. They do not exist in Ada
C. They are like arrays
D. They are used for passing variables by value
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now