Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

IO1 NAME: Extra 1 .(20 points) Predict the output of the following program. You

ID: 3720464 • Letter: I

Question

IO1 NAME: Extra 1 .(20 points) Predict the output of the following program. You may the lines below: if you believe there are not enough lines, please add liness needed. Recall problem easier). Variables are stored at addresses as follows Page 5 Seat: 222-10 owing program. You may not need all that,%X means print as base 16 (this is supposed to make the scope main) scope: river) 5558 445 555C 444C 5560 5564 #defineCRTSECURE NOWARNINGS #include - - - int river (int a, int b, int void main() intq) int x 333, y 444, 2-55s river (x, y, &x;,&y;) z ; int river (int a, int b, int *p, int ) a, b, p,q,p, q, &p;, &q;) a 77; q 88; a,b,p,q, *p, tq ,&p;, &q;) ; return a;

Explanation / Answer

the output is as below

*1* 333 444 555 22FF3C 22FF38 22FF34

*3* 333 444 22FF3C 22FF38 333 444 22FF18 22FF1C

*4* 77 444 22FF3C 22FF38 333 88 22FF18 22FF1C

*2* 333 88 77 22FF3C 22FF38 22FF34

outut line *1*

in first line the 333 444 555 are the values of x y and z

then last 3 hexadecimal no is address of the x y z.

output line *3*

in line 3 333 444 are the value of x y

22ff3C 22ff38 are the address that are pasees to the function

333 444 that are the value that 22ff3C 22ff38 holds

22FF18 AND 22FF1C are the address of where the 22ff3C 22ff38 are stored

then we change value of a=77 and *q=88

output line *4*

77 444 as a is change to 77

22ff3C 22ff38 are the address that are pasees to the function

333 88 that are the value that 22ff3C 22ff38 holds

22FF18 AND 22FF1C are the address of where the 22ff3C 22ff38 are stored

output line *2*

333 88 77

=> 333 is the value of x that is never changed

as in the function we changed the value of a.

=>88 q that hold the address of the varialbe y and we change the valure of in the function so it will became 88.

=>77 from the function we return a that is 77 and it is assined to z so it will became 77.

22FF3C 22FF38 22FF34 and this is the address of the variable x y z..

if u have any query please ask me i ma here for help dont thumbs down.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote