+ 2
plz tell me why and how its output is 12
4 Answers
+ 1
plz reply fast
+ 1
my expectation of output was 20 ...because if number and total were added 5 times it would give result as 20..why isnt the output 20
+ 1
The loop runs 5 times. In each iteration the value of number is added to the value of total. If you add 2 five times to 2, the result is 2 + 2*5 which is equal to 12.
0
ohh....thanks....