How to write a for loop that generates sequence?

  • Thread starter Thread starter W4lshy
  • Start date Start date
W

W4lshy

Guest
I've been given the following assignment question and need help.

Write a "for" loop that generates the following sequence:
144, 81,36,9 (note: no comma after the last one)

Hint 1: 144 = 12*12; 81 = 9*9; 36 =6*6; 9 =3*3
Hint 2: System.out.print outputs the string without bringing you onto the next line i.e. use system.out.print for 64, 36, 16 but use System.out.println for 4
 
Back
Top