0

How to print the below pattern in java

7 76 765 7654 76543 765432 7654321 can anyone give me code

21st Oct 2018, 10:09 AM
K Bhavya
K Bhavya - avatar
2 ответов
+ 6
Or, you can do it with one loop if you're Chad. ;> for (String i = "7"; i.length() <= 7; i += Integer.toString((i.charAt(i.length()-1))-49)) { System.out.println(i); }
21st Oct 2018, 2:14 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
You can do it with two nested for loops. You can see my example solution here https://code.sololearn.com/cuBtngCbEd20/?ref=app. Hope it helps you.
21st Oct 2018, 10:21 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar