PPL MCQ
PPL MCQ
5. What happens if you try to change the value of a named constant in a program? [ ]
A) Python
B) Ruby
C) C++
D) JavaScript
A) Just-In-Time
D) Just-In-Time Translation
C) Reduced readability
A) Return value
B) Argument
C) Variable
D) Statement
14. In which programming paradigm are sub-programs often emphasized as first-class citizens? [ ]
A) Procedural programming
B) Object-oriented programming
C) Functional programming
D) Declarative programming
D) To create a loop
16. Which of the following is a common method for passing parameters to a sub-program [ ]
A) Pass-by-value
B) Pass-by-reference
C) Pass-by-name
B) A copy of the variable is made, and changes do not affect the original
C) A constant value
D) A temporary variable
A) Pass-by-value
B) Pass-by-reference
C) Pass-by-name
D) Pass-by-object
Fill in the Blanks:
1. The set of rules that defines the structure of valid statements in a programming language is
known as ________
3. Context-free grammars are often used to formally define the ________ of programming
languages.
4. Ambiguity in syntax can lead to multiple interpretations, making it difficult to determine the
________ of a program.
5.In programming language design, the distinction between syntax and semantics is crucial for
creating a ________ and reliable language.
6. A ________ is a fixed identifier that represents a value that cannot be changed during program
execution.
7. The ________ environment maintains the mapping of variable names to their corresponding
values and memory locations.
8. Using named constants improves code ________ by providing meaningful names instead of
arbitrary values.
9. In a referencing environment, each variable has an associated ________ that indicates its
current value.
10. If a program attempts to modify a named constant, it typically results in a ________ error during
compilation.
11. In short-circuit evaluation, the second operand is evaluated only if the first operand does not
determine the ________ of the expression.
12. An assignment statement typically assigns a value to a variable using the ________ operator.
13. When using mixed-mode expressions, it is important to be aware of type ________ to avoid
unexpected results during calculations.
14. Short-circuit evaluation is commonly used with logical operators such as ________ and
________.
15. In an assignment statement, the value on the right-hand side is evaluated and then stored in the
variable on the ________ side.
18. In some languages, you can pass a subprogram as a parameter to create ________ callbacks for
handling events.
19. A subprogram parameter can be defined as a ________ to enhance modularity and reusability of
code.
20. When defining a subprogram that accepts another subprogram as a parameter, it is essential to
ensure that the signatures match in terms of ________ and number of parameters.
MCQ:
Answers :
1.B 2.B 3.A 4.B 5.B 6B. 7.C 8.A 9.B 10.B 11.B 12.B 13.B 14.C 15.B 16.D
17.B 18.B 19.B 20.C