Java Program to print square of numbers…


This program will print squares of numbers from 1 to 10.

class Square
{
public static void main(String args[])
{
int i=1,n=10;
System.out.println(“NUMBERtSQUARE”);
while(i<=n)
{
System.out.println(i +”t”+ i*i);
i++;
}
}
}

Add Comment