fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // your code goes here
  13. for(int i = 2; i<=9; i++) {
  14.  
  15. for(int k = 1; k<=9; k++) {
  16.  
  17. int result = i * k;
  18.  
  19. System.out.println(result);
  20.  
  21. }
  22.  
  23. }
  24. System.out.println();
  25.  
  26. int j = 1;
  27.  
  28. int sum = 0;
  29.  
  30. for(int i = 2; i<=9; i++) {
  31.  
  32. while(j<=9) {
  33.  
  34. sum = i * j;
  35.  
  36. System.out.println(i + " x "+j+ " = "+sum);
  37.  
  38. j = j+2;
  39.  
  40. if(j == 11) {
  41.  
  42. j = 1;
  43.  
  44. break;
  45.  
  46. }
  47.  
  48. }
  49.  
  50. }
  51. }
  52. }
Success #stdin #stdout 0.18s 44328KB
stdin
Standard input is empty
stdout
2
4
6
8
10
12
14
16
18
3
6
9
12
15
18
21
24
27
4
8
12
16
20
24
28
32
36
5
10
15
20
25
30
35
40
45
6
12
18
24
30
36
42
48
54
7
14
21
28
35
42
49
56
63
8
16
24
32
40
48
56
64
72
9
18
27
36
45
54
63
72
81

2 x 1 = 2
2 x 3 = 6
2 x 5 = 10
2 x 7 = 14
2 x 9 = 18
3 x 1 = 3
3 x 3 = 9
3 x 5 = 15
3 x 7 = 21
3 x 9 = 27
4 x 1 = 4
4 x 3 = 12
4 x 5 = 20
4 x 7 = 28
4 x 9 = 36
5 x 1 = 5
5 x 3 = 15
5 x 5 = 25
5 x 7 = 35
5 x 9 = 45
6 x 1 = 6
6 x 3 = 18
6 x 5 = 30
6 x 7 = 42
6 x 9 = 54
7 x 1 = 7
7 x 3 = 21
7 x 5 = 35
7 x 7 = 49
7 x 9 = 63
8 x 1 = 8
8 x 3 = 24
8 x 5 = 40
8 x 7 = 56
8 x 9 = 72
9 x 1 = 9
9 x 3 = 27
9 x 5 = 45
9 x 7 = 63
9 x 9 = 81