Modern Programming Languages MCQs with Answers
Practice important Modern Programming Languages MCQs with answers and explanations.
Multiple Choice Questions
Q841: What is the term for an explicit type conversion in C?
- A: Casting
- B: Coercion
- C: Narrowing
- D: Function call
View Answer
A
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
View Answer
A
Q843: Fill in the blank: A mixed-mode expression has operands of ______.
- A: Boolean type
- B: integer type
- C: different types
- D: string type
View Answer
C
Q844: Which programming language allows user-defined overloaded operators?
- A: FORTRAN 77
- B: Ada
- C: HTML
- D: Java
View Answer
B
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
View Answer
C
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
View Answer
C
Q847: What Boolean operator is used for XOR in FORTRAN 77?
- A: !
- B: #
- C: xor
- D: .NE.
View Answer
C
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
View Answer
B
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
View Answer
B
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
View Answer
C