Question 9851 – Programming
February 13, 2024Question 9782 – Programming
February 13, 2024Question 9873 – Programming
Consider the following program is pseudo-Pascal syntax.
program main; var x: integer; procedure Q [z:integer); begin z: z + x; writeln(z) end; procedure P (y:integer); var x: integer; begin x: y + 2; Q(x); writeln(x) end; begin x:=5; P(x); Q(x); writeln(x) end.
What is the output of the program, when
(a) The parameter passing mechanism is call-by-value and the scope rule is static scooping?
(b) The parameter passing mechanism is call-by-reference and the scope rule is dynamic scooping?
Correct Answer: A
Question 28 Explanation:
Note: Out of syllabus.
Theory Explanation is given below.
Subscribe
Login
0 Comments