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

1. Given the following piece of code, provide the resuts of the printfsO or assi

ID: 3721990 • Letter: 1

Question

1. Given the following piece of code, provide the resuts of the printfsO or assignme nt statements as requested. The Mblank comment indicates that you need to show the actual output of that printf Oon that line. Assume that the variables "result" number1". and "umber2 have addresses of. 1885020, 1885032 and 1885044, respectively. The first line has been done for you. Each line is worth 2 points (yes you receive 1I free pt ) void integer ltiplication (int res, int l. int2) int main Ivoid / "blank 1*/ blank 2*/ printf printf {-Result: td. Nunber1: {-Addresses of Result : ld. ld. 31rber2: Nu ber 1: %d,n", result. nunber1, nunber2); a. Nunber2: ldin.. ‘result, inunber, nunbet2) blank 3 /"blank 4 integer-multiplication {'result, nun,ptr. ntr); Number 1 : 3luaber 2: id, Nunber2: tdla, ‘result. tnberl. id'in", result. mober 1, nunbe 12); /*blank 5 printf ps intf ld- td. inunber2); {-Addresses of Result : {"Result: d' N.be r1: etuen O void integer multiplication (int res, int mlint m *blank 7 blank printf {-Result of multiplying id by td is lin.. *ral. .nun2. *res); Answers: blank 1/ blank 2 blank 3/ What is the actual contents of numl ptr? blank 4 What is the actal contents ofnum pt2 blank S blank 6 blank 7 blank 8 Instructor: Andrew S.O' Fallon

Explanation / Answer

blank2- prints the address of result(1885020), number1(1885032) and number2(1885044) before performing multiplication

blank3- num1_ptr stores the address of number1(1885032) so num1_ptr=1885032 and value at 1885032 contains the value 5

blank 4-  num2_ptr stores the address of number2(1885044) so num1_ptr=1885044 and value at 1885044 contains the value 9

blank 5-  prints the address of result(1885020), number1(1885032) and number2(1885044) as it is after performing multiplication

blank 6- prints Result: 45(after performing multiplication), Number1: 5, Number2: 9

blank 7- prints the content of res (address of Result: 1885020), num1 (address of number1=1885032) and num2(address of number2 =1885044)

blank 8- prints *num1=*(1885032)=5, *num2=*(1885044)=9, *res=*(1885020)=45