edited by
1,035 views

1 Answer

1 votes
1 votes
Since k is passed by ref so k and x will be pointing to same memory loc.while y which is passed by value has value of l . Y= 1.

Now in p function, x or k = 6. And y remains same . Y= 1.

Therefore z = (6 + 1) = 7

7

Related questions

0 votes
0 votes
1 answer
1
shree asked Nov 22, 2014
531 views
What will be the second value printed by the program if parameter passing mechanism is call by reference?int b=10 //global begin procedure func(int x,int y) begin print(b...
0 votes
0 votes
1 answer
2
Isha Karn asked Dec 9, 2014
529 views
void main() { int x=10, y=5; swap(x,y); print(x,y); } void swap(int a, int b) { int c, x=0; c=a; a=b; b=c; }what is output using call by text?a) 5 0b) 5 10c) 10 0d) ...
1 votes
1 votes
4 answers
3
Isha Karn asked Dec 9, 2014
994 views
int i = 1; int main() { int a[]= { 0,1, 2} ; f(a[i], i); printf("%d", a[i]); } void f(int x, int y) { y++; x=5*i; }In above function f() uses " call by name" technique, w...