Thursday, September 12, 2013

For Loops

class ForDemo {
public static void main(String args[]) {
int count;

for(count = 1; count < 25; count = count+1)
System.out.println("This is count: " + count);
System.out.println("Done!");
}
}


//Reverse Order
class ForDemo {
public static void main(String args[]) {
int count;

for(count = 99; count > 0; count = count-1)
System.out.println("This is count: " + count);
System.out.println("Done!");
}
}

No comments:

Post a Comment