Question: GESTION 0 . ( 2 0 pointe ) Determine the output of the following program ( written in a C lilice langunge ) for the

GESTION 0.(20 pointe)
Determine the output of the following program (written in a C lilice langunge) for the following parameter pasuing mechunioms:
a) definitional mechaniam, varinble parameter (call by reference)
b) copy mechanism, value parameter
d) coll by nechanism, value-result parameter
d) call by name (normal order evaluation)
int x=12,y=10;
void tswap (int pa, int pb) &
int timp;
tmp -pa;
pa-pb;
pb-tmp;
x=x+pa;
x-x-pb;
y++;
}
printf ("%d %d %d %d
",pa,pb, x,y);
int main()(
int a=4;
tswap (x,a);
printf ("%d %d %d
",x,y,a;
tswap (++x,++y);
printe ("%d %d %d
",x,y,a;
}
return 0 ;
Assume ++x increments the variable and then gives the reference of the variable. In other words, it can be used as an l-value.
a)
-4,12,-4,11
-4,11,12,
27,-2,27,-2
27,-2,12,
b)
4,12,4,11
4,11,4,
12,5,12,13
12,13,4,
c)
d)
-4,12,-4,11
-4,11,12,
2930,0,2829?30,-10?0
3029,0,12
(due to ambiguity from printf)mm
 GESTION 0.(20 pointe) Determine the output of the following program (written

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!