repl.it
@Hariz_Hazril/

1 to 10 dot - Increase

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
public class Main {
	public static void main(String[] args) {
		for (int i = 1; i <= 10; i++) { /* (i<=20) - Ulang 20 kali */
				for (int n = 1; n <= i; n++) { /* (n<=i) - maximum i */
					System.out.print("*");
					//System.out.print(n+"<="+i);
				}
			System.out.println();
		}
	}
}

 /*
   line  |   dots  |  n<=i                    |
   1     |    1    |  1<=1                    |
   2     |    2    |  1<=2,2<=2               |
   3     |    3    |  1<=3,2<=3,3<=3          |
   4     |    4    |  1<=4,2<=4,3<=4,4<=4     |      
   5     |    5    |  1<=5,2<=5,3<=5,4<=5,5<=5|
   */
Fetching token
?