Question: Q 2 . ( 3 0 points ) Determine the output of the following progtam ( written in a C like language ) for the

Q2.(30 points) Determine the output of the following progtam (written in a C like language) for the
following parameter passing mechanisms. (Assume ++var increments the variable and then gives the
reference of the variable. In other words, it can be used as an l-value)
int x=8,y=12;
void aFun(int a, int b)
at+;
b--;
x=x+a;
y=y-b;
print (a,b,x,y);
}
int main()
int m=10;
aFun(x,m);
print (m,x,y);
arun(++x,++y);
print (m,x,y);
a)(10 pts) Pass by Value output ?
b)(10pts) Pass by Reference out put?
c)(10 pts) Pass by Name output?
 Q2.(30 points) Determine the output of the following progtam (written in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!