Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
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
View Answer
D
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
View Answer
B
Q293: What is the default case used in Ada's case statement?
- A: when others
- B: when default
- C: when else
- D: when any
View Answer
A
Q294: Which keyword is used to start the block section in Ada?
- A: declare
- B: begin
- C: execute
- D: loop
View Answer
B
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.
View Answer
A
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
View Answer
B
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
View Answer
B
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
View Answer
A
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.
View Answer
A
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
View Answer
A