What are the index variable in the for loop?

1 answer

Answer

1073178

2026-08-17 00:45

+ Follow

Java
Java

The for loop uses a counter or an index variable to loop through the statements. This variable is used through the loop, changed and finally compared with the loop condition for consideration of the loop's next cycle.

The variable(s) used inside the for loop for comparison (with the mentioned condition) and increment/decrement is know as the index variable.

for example (Java) :

for(int i=1; i<5; i++){

...

}

in this example, integer 'i' is the index variable.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.