0
Why not make int i=0 while initializing? I dont get that logic.
2 Antworten
+ 3
Hi Shankar Devaraju iterations need not necessarily begin with a value 0 and this code calculates sum of first 100 natural numbers so you need not include 0.
You generally start iteration from value 0 when you are traversing an array or a String or any other collection because Java has zero based indexing.
+ 2
Natural Numbers donot include 0