public class Program {
public static void main(String[] args) {
for (int i = 1; i <= 598; i+=3) {
System.out.println(i);
}
}
}
int counter = 1;
while (counter<598) // It will go on until the counter hits "greater than 598"
{
System.out.println(counter);
counter +=3; //This increases the value by 3 in each loop
}
I'm a beginner and I have a quiz tomorrow on writing while loops in computer math so i have to understand this.
How would I write a while loop for
1
4
7
10
...
598
Please explain easily as I'm a beginner and I have trouble undetstand the technical Java terms still