Nested Loops Use some simple nested for loops to generate all possible coordinates from (0,0) up to (5,5). A for loop is similar to an if statement, but it combines three semicolon-separated pieces information between the parentheses: initialization, condition and a final expression. For example, if we want to check the grade of every student in the class, we loop from 1 to that number. until $x is equal to six. Programming - For Loop. The