What should be the output of the program??and why?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What should be the output of the program??and why??

According to me output should be 11 but it is coming out 12 https://code.sololearn.com/cNFy6QE7Hwhx/?ref=app

18th Feb 2020, 2:35 PM
Prakhar
3 Answers
+ 5
Your code there is a warning. "i" may be undefined.
18th Feb 2020, 3:00 PM
Pedro H.J
Pedro H.J - avatar
+ 4
I added step by step. See this code. https://code.sololearn.com/cT83kg18c2ru/?ref=app
18th Feb 2020, 2:56 PM
Pedro H.J
Pedro H.J - avatar
18th Feb 2020, 3:04 PM
Pedro H.J
Pedro H.J - avatar