Consider the following pseudo-code (all data items are of type integer):
procedure P(a, b, c);
a := 2;
c := a + b;
x := 1;
y := 5;
z := 100;
P(x, x*y, z);
Write ('x = ', x, 'z = ', z);
Determine its output, if the parameters are passed to the Procedure P by
Note that pass by name is similar to pass by reference in the sense that by substituting the actual parameters into the function body, the function body can both read and write the given parameters.
for call by reference here:
how address of x*y will pass to b in procedure P(a, b, c)??
Write ('x = ', x, 'z = ', z); ... sir can you plz explain this line as i am not getting it .. what is meant by 'x = ' ?? and why two value not 4 ?
if call by need was also asked;
then output would be 2,7 only, am i right??
Then I think this ques answer is wrong for Call By Name
When will be the final official key...