can someone please explain how they got this answer The foll
can someone please explain how they got this answer?
The following program compilers and runs without errors. What will the program print out? Show all your computations in details.Solution
a)
xx=my_fun(xx,k,ypt)
in this function
we are doing x+=5 and returning x*4
initially x is 20 after adding 5 it it 25 and after multiplying with 4 it is 100
hence xx =100
b)Passing by value so value doesnot chnage k=6
c)In function we are doing *fp = float(x)+*fp+5.0
float(x)=25 as we have already incremented x with 5 in previous step
*fp=30
hence *fp=25+30+5=60
we passed reference to the funtion hence value changes
