write a program to print the squares of numbers 1 to 5 in java class 9
Answers
Answered by
5
Answer:
ning it needs to show the cube and square of the number. Any help will be appreciated.
Thanks!
public class CubesAndSquares
{
public static void main (String [] args)
{
int number;
int square;
int cube;
System.out.println("Number\tSquare\tCube");
for (number=1; number<10; number++);
{
square= number * number;//
cube= number * square;
System.out.println(number+"\t"+square+"\t"+cube);
}
}
}
Explanation:
please follow me and thanks my answer
Similar questions