Java #2: Decreasing For Loop Example

//Decreasing For Loop

//int dCounter starts at 10,until it is = to -1, and it is going down by 1 each iteration//
for (int dCounter =10; dCounter>-1;dCounter–)
{
//printing the current value of dCounter//
System.out.println(“The current value of the counter is = “+dCounter);
}

 

 

Leave a comment