/** * For --- A program to demonstrate the use of the for loop * @author Blanca Polo */ public class For1{ /** * Demonstrates the use of the For loop AND it will demo the use of * the mod operator as it is used to determine if a number is odd or even * @param arg A string array containing the command line arguments. * @return No return value. */ public static void main(String arg[ ]){ final int IEND = 10; for(int i=1; i<= 10; i = i+2){ System.out.print("\tThe value of i is: " + i); if(i%2 == 0){ System.out.println(" and it is even"); } else{ System.out.println(" and it is odd "); } System.out.println("value of i = "+ i); } // for loop ends System.out.println("out of here!!!"); } //closes main }// closes class For1