38. What is the value stored in the variable myNum after the following assignmen
ID: 3907223 • Letter: 3
Question
38. What is the value stored in the variable myNum after the following assignment statement execute? a. 3 c. 4.6 d. 115 e. None of these 39. What is the value of cookies after the following statements execute? int number 38, children-4, cookies cookies number children; b. 4 d. 9.5 40. What is the value of number after the following statements execute? int nunber; number 18/4 a. 4.5 b. 4 c. 2 41. What is the value of number after the following statements execute? int number; number 18 % 4 + 2; a. 3 b. 4 c. 6.5 d. 0 e. unknown 42. What is output of the following statement? coutExplanation / Answer
38.) a) 3
myNum=23 % 5
% gives remainder
myNum=3 //23 divided by 5 remiander is 3
39.)a)2
number=38
children=4
cookies=number % children
As explained above,cookies will contain 2 since when 38 is divided by 4 remiander is 2
40.)b)4
Since when 18 is divided by 4 it is 4 and remainder is 2
41.)b)4
By Bodmas rule,first % will be caluclated
number=18 % 4+2 =2+2=4
42.)b)12
4*(15/(1+3))=4*(15/4)=4*3=12
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.