Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q261: In Ada, what is the range of indexes for arrays defined as type Int_Buffer is array(1..10) of Integer;?
- A: 0..10
- B: 1..10
- C: 1..20
- D: 0..20
View Answer
B
Q262: Which operator in Ada is used to access individual fields of a record?
- A: . (dot operator)
- B: -> (arrow operator)
- C: : (colon operator)
- D: ; (semicolon)
View Answer
A
Q263: What type of data structure does Ada use to ensure type safety in place of C's union?
- A: Arrays
- B: Records
- C: Discriminated records
- D: Pointers
View Answer
C
Q264: What is the assignment operator used in Ada?
- A: =
- B: :=
- C: ->
- D: :
View Answer
B
Q265: In Ada, the index of an array can be of what type?
- A: Integer only
- B: Any discrete type
- C: String only
- D: Float only
View Answer
B
Q266: How does Ada handle array index bounds?
- A: Indexes always start from 0
- B: Indexes can be defined by the programmer
- C: Indexes start from 1 and can't be changed
- D: Array size is fixed
View Answer
B
Q267: What is the main feature of discriminated records in Ada?
- A: They are unsafe
- B: They have dynamic sizing
- C: They use discriminants to track data type
- D: They are similar to arrays
View Answer
C
Q268: Which of the following can Ada arrays use as indexes?
- A: Integers only
- B: Positive numbers only
- C: Any discrete type
- D: Strings only
View Answer
C
Q269: What does the Ada if statement require after each condition?
- A: End if
- B: End case
- C: End switch
- D: End loop
View Answer
A
Q270: What is the purpose of the elsif keyword in Ada?
- A: To define a new variable
- B: To specify an additional condition in an if statement
- C: To create a loop
- D: To close an if statement
View Answer
B