int mamat 8 1 10 20, 30, 40, 50, 50, 70 int squarer 3 J[ 3 1 t 2, 4, S 3, 5, 7 0
ID: 3573031 • Letter: I
Question
int mamat 8 1 10 20, 30, 40, 50, 50, 70 int squarer 3 J[ 3 1 t 2, 4, S 3, 5, 7 0, 1, 2 )I for( int i on i 101 i t .witch(i). case 11 case 5 if( i 2 i II i 2 1 II i 2 wk i i i t i)) numa 3 +1 break case 4: t i 1 1 nums [i 3 numa t i numa i 1 nums i 2 691 break 50 t 60 I case 6: case 7 square t 211 i 6 1 (i 4) i 4 break case 8: square i 8 2 1 (i 4 1 i et i I 3 )t 20 i) nums squar nums! 7 1 break case 91 squarer i 10 10 i 1 squarel 0 t 2 1 square 111 1 break case 10 squaret 411 i 8 3 squaret icol, 30 break default int n 01 while n i) nums i break;Explanation / Answer
nums
num value changed at locations 2,3 and 6 as those are the locations which are run in the default section.
for i=2
while loop in default will run twice,
for i=3
thrice
and for i=6
5 times.adding multiples of 5 to the existng value.
square
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.