Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 42
Q821:
What is the main issue with unions in Pascal?
A. Tags are mandatory.
B. Type checking is ineffective.
C. Union assignments are faster.
D. Unions are not supported.
Correct Answer: B
Chapter: 42
Q822:
Which operator is used for implicit dereferencing in Fortran90?
A. =
B. *
C. ->
D. =>
Correct Answer: D
Chapter: 42
Q823:
Fill in the blank: In Ada, dynamic objects are automatically ______ at the end of the pointer's scope.
A. deallocated
B. initialized
C. assigned
D. referenced
Correct Answer: A
Chapter: 42
Q824:
Which language provides a with clause for abbreviating record references?
A. COBOL
B. Pascal
C. Ada
D. Fortran90
Correct Answer: B
Chapter: 42
Q825:
Fill in the blank: Memory leakage occurs when heap-dynamic variables are ______ by any program pointer.
A. unreferenced
B. assigned
C. allocated
D. explicitly deallocated
Correct Answer: A
Chapter: 42
Q826:
Which of the following is a composite data type that groups heterogeneous elements?
A. Array
B. Record
C. Union
D. Pointer
Correct Answer: B
Chapter: 42
Q827:
What is the output of *(p+5) in C, where p is a pointer to the start of an array stuff?
A. The value of the 6th element in stuff.
B. The memory address of stuff[5].
C. The size of the array.
D. None of the above.
Correct Answer: A
Chapter: 42
Q828:
Fill in the blank: ______ expressions consist of operators, operands, parentheses, and function calls.
A. Arithmetic
B. Conditional
C. Logical
D. Assignment
Correct Answer: A
Chapter: 42
Q829:
Which language uses garbage collection to handle memory management?
A. C
B. Pascal
C. Java
D. Fortran90
Correct Answer: C
Chapter: 42
Q830:
What is the primary purpose of pointers in programming?
A. Arithmetic calculations
B. Dynamic storage management
C. Sorting algorithms
D. Logical operations
Correct Answer: B
Chapter: 42
Q831:
Fill in the blank: Dynamic subscripts are used in arrays but disallow ______ in records.
A. type checking
B. dynamic access
C. pointer arithmetic
D. composite data
Correct Answer: A
Chapter: 42
Q832:
Which design issue is common for both pointers and unions?
A. Memory allocation
B. Type checking
C. Reference ambiguity
D. Operator precedence
Correct Answer: B
Chapter: 43
Q833:
How many operands does a unary operator have?
A. One
B. Two
C. Three
D. Four
Correct Answer: A
Chapter: 43
Q834:
Which operator in C++ is used for pointers?
A. &
B. *
C. +
D. !
Correct Answer: B
Chapter: 43
Q835:
What is operator overloading?
A. Using operators for type conversion
B. Using an operator for multiple purposes
C. Using operators for narrowing
D. Using operators for Boolean logic
Correct Answer: B
Chapter: 43
Q836:
What is an example of implicit type conversion?
A. int to float
B. (int)angle
C. Float(sum)
D. div
Correct Answer: A
Chapter: 43
Q837:
What is the issue with coercion in expressions?
A. It increases compiler optimization
B. It increases type error detection
C. It decreases type error detection
D. It improves runtime performance
Correct Answer: C
Chapter: 43
Q838:
What does short-circuit evaluation in Boolean expressions do?
A. Prevents side effects in expressions
B. Always evaluates all operands
C. Skips evaluation when result is determined
D. Requires explicit coercion
Correct Answer: C
Chapter: 43
Q839:
Which of the following is an example of a run-time error?
A. Syntax error
B. Division by zero
C. Incorrect casting
D. Overflow is a compile-time error
Correct Answer: B
Chapter: 43
Q840:
What is the precedence order in arithmetic expressions?
A. +, -, *, /
B. parentheses, unary operators, **, *, /, +, -
C. *, /, +, -
D. Parentheses, +, -, **, /, *
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now