Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   o/p of call by reference needed! (http://www.go4expert.com/forums/o-p-reference-t7355/)

chocoboy308 17Nov2007 16:33

o/p of call by reference needed!
 
Guys I need the o/p of the foll pseudo code in terms if call by reference.Plz ignore the small programmin errors as this a pseudo code not a running code

Code:

SUM(x,y,z)
{
x=y*x;
z=z+x;
}

main()
{
a=3;
b=7;
SUM(b,b-a,a)
printf(a,b,b-a);
}

here a=31,b=28,but what will be the value of b-a will it be 4 which we get after computing the sum function or will it be -3 from the new values of and b(i.e 28-31)



2)

Code:
Code:

value(x,y,z)
{
  x=x*y;
  x=x+y+z;
}

main()
{
 a=3;
 value(a,2*a,a);
 printf("value of a,a);
}

the value function will hold after refernce (27,6,3)
In this case which value of a does it print??
plzz help me

chocoboy308 18Nov2007 18:08

Re: o/p of call by reference needed!
 
plz somebody help me in this matter!!

Salem 18Nov2007 18:20

Re: o/p of call by reference needed!
 
You asked here already.
http://cboard.cprogramming.com/showthread.php?t=95905

But you ran away without even bothering to engage in a discussion, but instead chose to wander from board to board in the hope someone will just give you the answer.


All times are GMT +5.5. The time now is 09:20.