Skip to main content

Modern Programming Languages MCQs with Answers

Practice important Modern Programming Languages MCQs with answers and explanations.

Chapter: 43
Q841:
What is the term for an explicit type conversion in C?
A. Casting
B. Coercion
C. Narrowing
D. Function call
Correct Answer: A
Chapter: 43
Q842:
In Ada, how are short-circuit evaluations specified?
A. with ‘and then’ and ‘or else’
B. Using bitwise operators
C. Only logical operators
D. Not possible in Ada
Correct Answer: A
Chapter: 43
Q843:
Fill in the blank: A mixed-mode expression has operands of ______.
A. Boolean type
B. integer type
C. different types
D. string type
Correct Answer: C
Chapter: 43
Q844:
Which programming language allows user-defined overloaded operators?
A. FORTRAN 77
B. Ada
C. HTML
D. Java
Correct Answer: B
Chapter: 43
Q845:
What is an example of a potential issue with overloaded operators?
A. Enhanced readability
B. Better optimization
C. Nonsense operations can be defined
D. Compiler runs faster
Correct Answer: C
Chapter: 43
Q846:
What is a shortcoming of defining operand evaluation order in language definition?
A. It allows coercions
B. It prevents functional side effects
C. It limits compiler optimizations
D. It increases inflexibility
Correct Answer: C
Chapter: 43
Q847:
What Boolean operator is used for XOR in FORTRAN 77?
A. !
B. #
C. xor
D. .NE.
Correct Answer: C
Chapter: 43
Q848:
What is the outcome of the following function? int fun(int &x) { x = x + 1; return x * 2; } when a=10; b=a+fun(a);
A. 10, 12
B. 11, 22
C. 10, 22
D. 12, 24
Correct Answer: B
Chapter: 44
Q849:
What is a control structure in programming?
A. A collection of variables
B. A control statement and the statements it controls
C. A debugging tool
D. A type of hardware control
Correct Answer: B
Chapter: 44
Q850:
Which level of control flow deals with execution among statements?
A. Within expressions
B. Among program units
C. Among program statements
D. None of the above
Correct Answer: C
Chapter: 44
Q851:
What control statements should a language have, according to the evolution section?
A. Arithmetic operations
B. Logical loops and two-way selection
C. Complex flowcharts
D. Hardware integration
Correct Answer: B
Chapter: 44
Q852:
Which language used IF (.NOT. condition) GOTO for selection?
A. ALGOL 60
B. Pascal
C. FORTRAN
D. Ada
Correct Answer: C
Chapter: 44
Q853:
In ALGOL 60, what keyword is used to specify a compound statement?
A. begin
B. start
C. open
D. compound
Correct Answer: A
Chapter: 44
Q854:
Which rule does Pascal use for nested selectors?
A. Else goes with the first then
B. Else goes with the last then
C. Else goes with the nearest then
D. Else is not allowed
Correct Answer: C
Chapter: 44
Q855:
What is an advantage of Ada's "end if" in nested selectors?
A. Improved flexibility
B. Enhanced readability
C. Reduced reliability
D. Reduced flexibility
Correct Answer: B
Chapter: 44
Q856:
In C, how is execution flow through multiple selectors controlled?
A. It is encapsulated
B. It is restricted
C. It is unrestricted
D. It uses default clauses
Correct Answer: C
Chapter: 44
Q857:
What is the syntax for FORTRAN 77’s counter-controlled loops?
A. DO variable = start, finish [, stepsize]
B. FOR variable = start, finish [, stepsize]
C. LOOP variable = start, finish [, stepsize]
D. None of the above
Correct Answer: A
Chapter: 44
Q858:
What happens to the loop variable after a FORTRAN 77 loop?
A. It becomes undefined
B. It retains its last value
C. It is re-initialized
D. It is removed from memory
Correct Answer: B
Chapter: 44
Q859:
In Ada, where is the scope of the loop variable?
A. Global
B. Local
C. Loop body
D. Method-level
Correct Answer: C
Chapter: 44
Q860:
How does Java's for loop differ from C++?
A. It allows only Boolean control expressions
B. It has no initial expression
C. It skips pretest phase
D. It allows undefined variables
Correct Answer: A

Test Your Knowledge

Take a timed quiz on Modern Programming Languages

🚀 Start Quiz Now