4-7 Squares

posted Feb 23, 2014, 1:02 PM by Dlovan ismail   [ updated Feb 23, 2014, 1:04 PM by Karwan Jacksi ]
//This program demonstrates the for loop.

package squares;

public class Squares 
{
    public static void main(String[] args)
    {
            int number; // Loop control variable
            
            System.out.println("Number Number Squared");
            System.out.println("----------------------");

            for (number=1;number <=10; number++) 
            {
                System.out.println(number+"\t\t"+number*number);
            }
        
    }    
}

ċ
Squares.java
(0k)
Karwan Jacksi,
Feb 23, 2014, 1:02 PM
Comments