What is printed by following program, assuming call-by reference method of passing parameters for all variables in the parameter list of procedure P?
program Main(inout, output);
var a, b:integer;
procedure P(x, y, z:integer);
p(a+b, a, a);
I could not understand your solution. The variable 'a' is stored at location 100 whose value is updated to 3 by the code. Value stored at location 300 is updated to 10 which does not represent variable 'a', rather than it represented 'a+b'. So how 'a' got value 10?