- 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)); } } }

23rd Mar 2021, 7:17 AM
Arif Ansari
Arif Ansari - avatar
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...
23rd Mar 2021, 7:49 AM
A͢J
A͢J - avatar
+ 1
Thank you bro
23rd Mar 2021, 7:50 AM
Arif Ansari
Arif Ansari - avatar
0
Thanks Soumik
23rd Mar 2021, 7:56 AM
Arif Ansari
Arif Ansari - avatar