0

Please Explain out put 212128 how....?

https://code.sololearn.com/cnmvVZX7eDxB/?ref=app

13th Jun 2020, 6:46 AM
Subhash Vangari
Subhash Vangari - avatar
3 Answers
+ 7
• First iteration: m = 1 m = m(m+1) = 1(1+1) = 2 m++ (Now m = 3) • Second iteration: m = 3 m = 3(3+1) = 12 m++ (Now m = 13) • Third iteration: m = 13 m = 13(13+1) = 182 m++ (Now m = 183) 183 doesn't satisfy the condition.
13th Jun 2020, 7:00 AM
Harsh
Harsh - avatar
+ 2
Loop runs 1 time m=(1+1)×1=2 Then m++ so m = 3 Loop runs 2 time m=(3+1)×3=12 m++ = 13 Loop runs 3 time m=(13+1)×13=182 m++ = 183 183 > 20 so loop terminates there
13th Jun 2020, 6:58 AM
JME
+ 1
Thanks 😊
13th Jun 2020, 7:06 AM
Subhash Vangari
Subhash Vangari - avatar