- 3
Hi friends please explain this code.
for (int i=1;i<=10;i++){ System.out.println("______________"); for (int a=1;a<=10; a++) System.out.println(i+"x"+a+"="+(i*a)); } } }
3 Antworten
+ 2
Arif Ansari
Inner loop will iterate 10 times on each iteration of outer loop and it will print table of Multiplication of 1 to 10 numbers.
So for i = 1
1 * 1 = 1
1 * 2 = 2
1 * 3 = 3
.
.
.
.
1 * 10 = 10
now for i = 2
2 * 1 = 2
2 * 2 = 4
.
.
.
2 * 10 = 20
and so on...
+ 1
Thank you bro
0
Thanks Soumik