Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Chapter: 41
Q801:
Which feature weakens strong typing in C++ compared to Ada?
A. Lack of operators
B. Coercion rules
C. Memory allocation
D. Parameter passing
Correct Answer:
B
Chapter: 41
Q802:
Which language does not support decimal data types?
A. COBOL
B. Java
C. Ada
D. None of the above
Correct Answer:
B
Chapter: 41
Q803:
What is the main advantage of strong typing in programming languages?
A. Readability
B. Error detection
C. Code reusability
D. Memory allocation
Correct Answer:
B
Chapter: 41
Q804:
In C++, how are strings handled?
A. As primitive types
B. Using char arrays
C. As linked lists
D. As string objects
Correct Answer:
B
Chapter: 41
Q805:
Which of the following is not a primitive data type?
A. Integer
B. Boolean
C. Array
D. Floating Point
Correct Answer:
C
Chapter: 41
Q806:
Enumeration types in Ada allow symbolic constants to be _______.
A. Reused
B. Nested
C. Static
D. Immutable
Correct Answer:
A
Chapter: 41
Q807:
Which category of arrays provides the most execution efficiency?
A. Fixed stack dynamic
B. Stack-dynamic
C. Static
D. Dynamic
Correct Answer:
C
Chapter: 41
Q808:
What type of data type is represented by "digits 7 range 0.0..1000.0" in Ada?
A. Integer
B. Floating Point
C. Decimal
D. Boolean
Correct Answer:
B
Chapter: 41
Q809:
Which subscript types are allowed in Pascal arrays?
A. Integer only
B. Ordinal types
C. Floating-point
D. Character only
Correct Answer:
B
Chapter: 41
Q810:
Fill in the blank: ______ is an example of a strongly typed language.
A. FORTRAN 77
B. Ada
C. C
D. C++
Correct Answer:
B
Chapter: 41
Q811:
Fill in the blank: In C++, strings are implemented using ______ arrays.
A. Boolean
B. Integer
C. Char
D. Float
Correct Answer:
C
Chapter: 41
Q812:
Which of the following languages allows accuracy specifications in floating-point types?
A. FORTRAN 77
B. Ada
C. C++
D. Pascal
Correct Answer:
B
Chapter: 41
Q813:
Which programming language does not support enumeration types?
A. Pascal
B. Ada
C. C++
D. Java
Correct Answer:
D
Chapter: 42
Q814:
What is the key difference between an array and a record?
A. Arrays are heterogeneous, and records are homogeneous.
B. Arrays are homogeneous, and records are heterogeneous.
C. Arrays are logical groupings, and records are dynamic.
D. Arrays have faster access than records.
Correct Answer:
B
Chapter: 42
Q815:
Which language uses level numbers to define nested records?
A. COBOL
B. Pascal
C. Ada
D. Modula-2
Correct Answer:
A
Chapter: 42
Q816:
What type of reference includes all record names in a hierarchy?
A. Fully qualified references
B. Elliptical references
C. Pointer references
D. Dynamic references
Correct Answer:
A
Chapter: 42
Q817:
Which of the following languages initializes all pointers to null?
A. Pascal
B. Ada
C. Java
D. C++
Correct Answer:
B
Chapter: 42
Q818:
What is the term for a pointer pointing to a deallocated variable?
A. Memory leak
B. Dangling pointer
C. Lost heap variable
D. Null pointer
Correct Answer:
B
Chapter: 42
Q819:
Which type of union in Ada ensures safety by requiring a tag?
A. Non-discriminated union
B. Free union
C. Discriminated union
D. Dynamic union
Correct Answer:
C
Chapter: 42
Q820:
In C/C++, what is a void pointer used for?
A. Storing integers only
B. Pointing to any type
C. Type checking only
D. Deallocation only
Correct Answer:
B