Using Two Loop Indexes : for « JSP « Java Tutorial






<HTML>
  <HEAD>
    <TITLE>Using Two Loop Indexes</TITLE>
  </HEAD>

  <BODY>
    <H1>Using Two Loop Indexes</H1>
    <%
        for (int i = 0, doubleIndex = 0; i <= 10; i++, doubleIndex = 2 * i) {
            out.println("i: " + i + " doubleIndex: " + doubleIndex + "<BR>");
        }
    %>
  </BODY>
</HTML>








23.8.for
23.8.1.Using the for Statement
23.8.2.Finding Average Grades
23.8.3.Using Two Loop Indexes
23.8.4.Your for statement to loop through an array