Answer to Question #285988 in Java | JSP | JSF for kkkkkk

Question #285988

for loop

sample output

c. Number Square Cube

1 1 1

2 4 8

3 9 27

4 16 64

5 25 125

. . .

. . .

. . .

10 100 1000



1
Expert's answer
2022-01-09T03:08:39-0500


class NumberSquareCube {
    public static void main(String[] args) {
        System.out.printf("%-15s%-15s%-15s\n","Number","Square","Cube");
        for(int i=1;i<=10;i++){
            System.out.printf("%-15d%-15d%-15d\n",i,i*i,i*i*i);
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog