fork download
  1. final class Ideone {
  2.  
  3. public static void main(final String[] argv) {
  4. int acc = 0;
  5. for (int n = 1; n <= 9; ++n) {
  6. acc += 2;
  7. System.out.println("2 x " + n + " = " + acc);
  8. }
  9. }
  10. }
Success #stdin #stdout 0.06s 380224KB
stdin
Standard input is empty
stdout
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10
2 x 6 = 12
2 x 7 = 14
2 x 8 = 16
2 x 9 = 18