Computer Programming - Week 6
Computer Programming - Week 6
Example:
A program that prints and increments the value of an int counter variable if
the value of the counter is less than/equal to 10:
Example:
A program that prints and increments the value of an int counter variable
if the value of the counter is less than/equal to 10:
Example:
Example: for (int counter=3;counter<=10;counter++)
for (int counter=3;counter<=10;counter++)
{
{
if (counter == 5){
if (counter == 5) continue;
System.out.println(“counter =“ +
System.out.println(“counter =“ + counter);
counter);
return;
}
}
}
Computer Programming (JAVA) – Week 6 Page 1 of 2
Computer Programming (JAVA) – Week 6 Page 2 of 2