4-6 Number_Square_Cube

posted Feb 9, 2014, 2:02 PM by Dlovan ismail   [ updated Feb 9, 2014, 4:14 PM by Karwan Jacksi ]
// this program prints the number, square and the cube of only odd numbers from 0 to 100

package number_square_cube;

public class Number_Square_Cube 
{
    public static void main(String[] args)
    {
            System.out.print("Number\tSquare\tCube\n.....................\n");
            int i=1;

            do 
            {

                System.out.printf("%d\t%d\t%d\n",i,i*i,i*i*i);  
             i+=2;

            } while (i<101);
        
    }   
}

ċ
Number_Square_Cube.java
(1k)
Karwan Jacksi,
Feb 9, 2014, 2:02 PM
Comments