4-6 Number_Square_Cube

Post date: Feb 9, 2014 10:02:49 PM

// 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);

}

}