Reputation: 11
I've been working on the code, but the only thing i can get in the output is a box with the word that i put in. For example i need to enter the word "hippo" to make this shape
This is what i have done so far on the for loop.
for(int i = length; i > 0 ; i--)
{
out.println(word);
}
I need help please.
Upvotes: 0
Views: 1333
Reputation: 16536
Off the top of my head, the loop would look something like this.-
for(int i = length - 1; i >= 0 ; i --) {
System.out.println(word.substring(0, i));
}
Upvotes: 1