Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 13
Q221:
Ada includes a predefined library for __________.
A. Input/output, string manipulation, numeric functions
B. Networking, database management, GUI development
C. Memory management, threading, security
D. Graphics, sound, file management
Correct Answer: A
Chapter: 13
Q222:
Which Ada feature allows multiple threads of control to communicate?
A. Tasks
B. Functions
C. Procedures
D. Exceptions
Correct Answer: A
Chapter: 13
Q223:
What feature of Ada is designed to improve program reliability by preventing errors?
A. Strong typing
B. Dynamic typing
C. Operator overloading
D. Memory management
Correct Answer: A
Chapter: 13
Q224:
In Ada, the operator "/=" represents:
A. Not equal
B. Equal
C. Assignment
D. Modulo
Correct Answer: A
Chapter: 13
Q225:
Which operator in Ada is used for logical NOT?
A. Not
B. !
C. ~
D. #
Correct Answer: A
Chapter: 14
Q226:
Which operator in Ada is used for assignment?
A. :=
B. =
C. ==
D. :=:
Correct Answer: A
Chapter: 14
Q227:
In Ada, the assignment operator can be overridden in which case?
A. Inheritance from an abstract class
B. When using modular arithmetic
C. For floating-point types
D. In Boolean expressions
Correct Answer: A
Chapter: 14
Q228:
What is the main purpose of Ada's exception handling mechanism?
A. To catch errors at runtime
B. To define new data types
C. To improve program readability
D. To avoid modular types
Correct Answer: A
Chapter: 14
Q229:
Which of the following is not a predefined type in Ada?
A. Integer
B. Character
C. Modular
D. String
Correct Answer: D
Chapter: 14
Q230:
Ada's type 'Marks' defined as type Marks is range 0..100; is an example of which type?
A. Integer
B. Real
C. Modular
D. Enumeration
Correct Answer: A
Chapter: 14
Q231:
In Ada, which type is used for modular arithmetic with wraparound properties?
A. Integer
B. Real
C. Modular
D. Floating-Point
Correct Answer: C
Chapter: 14
Q232:
What does the 'Pred' function do in Ada for enumeration types?
A. It calculates the previous value in the enumeration.
B. It performs arithmetic operations.
C. It defines a fixed-point type.
D. It initializes an array.
Correct Answer: A
Chapter: 14
Q233:
Ada supports which of the following floating-point types with specified precision?
A. Fixed Point Types
B. Floating Point Types
C. Integer Types
D. Boolean Types
Correct Answer: B
Chapter: 14
Q234:
Which of the following types in Ada defines a floating-point number with 15 decimal digits of precision?
A. type Double is digits 15;
B. type Float is range -1.0..1.0;
C. type Real is range 0.0..100.0;
D. type Fixed is digits 10;
Correct Answer: A
Chapter: 14
Q235:
What does the 'delta' keyword represent in Ada's fixed-point types?
A. The spacing between values in the range
B. The maximum value of the type
C. The number of decimal digits of precision
D. The sign of the values
Correct Answer: A
Chapter: 14
Q236:
Which type in Ada is used for financial applications with decimal precision?
A. Ordinary Fixed Point Types
B. Decimal Fixed Point Types
C. Integer Types
D. Modular Types
Correct Answer: B
Chapter: 14
Q237:
In Ada, which operator is used for equality comparison?
A. =
B. ==
C. :=
D. /=
Correct Answer: A
Chapter: 14
Q238:
Ada allows you to define your own types, creating a new type by defining a ________.
A. Range
B. Data structure
C. Variable
D. Data type
Correct Answer: D
Chapter: 14
Q239:
The Ada compiler resolves ambiguity between symbolic literals in enumeration types based on ________.
A. The type of the variable
B. The order of declaration
C. The range of values
D. The size of the variable
Correct Answer: A
Chapter: 14
Q240:
Which of the following types is used for true/false conditions in Ada?
A. Boolean
B. Integer
C. Modular
D. Floating-Point
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now