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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: