0
How do i reverse the alphabet and taking off the fisrt char?
I want to print this, but without the replace or subtring function zywvtsrqponmlkjihgfedcba ywvtsrqponmlkjihgfedcba wvtsrqponmlkjihgfedcba . . . rqponmlkjihgfedcba qponmlkjihgfedcba ponmlkjihgfedcba . . . edcba dcba cba ba a
6 odpowiedzi
+ 2
Something like this 👇
String s = "zywvtsrqponmlkjihgfedcba";
int len = s.length();
for(int i = 0; i < len; i++)
{
for(int j = i; j < len; j++)
{
System.out.print(s.charAt(j));
}
System.out.println();
}
(Edit)
Someone asked the same question just today. Check the following thread
https://www.sololearn.com/Discuss/2220519/?ref=app
+ 2
You can achieve that by using nested for-loop. Outer loop <i> goes from zero to string length - 1. Inner loop <j> goes from <i> to string length - 1. Print character at index <j> within the inner loop. And insert a new line character after the inner loop to separate the lines 👍
+ 2
No problem Diego Becerril 👌
+ 1
Ipang can you put the exaple please? thank you
+ 1
thank you soooooo much, you save meeee 🤩
0
Thanks, but i’m actually searching the answer without any method or function, just with the main