Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Enumerate the most commonly used classifications of costs.

Answered: 1 week ago

Question

Describe the team dynamics at Facebook.

Answered: 1 week ago