Print the following pattern using string methods only. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Print the following pattern using string methods only.

B LL UUU EEEE JJJJJ

6th Jul 2022, 12:33 PM
Asmit Choudhary
Asmit Choudhary - avatar
7 Answers
+ 3
6th Jul 2022, 1:14 PM
Asmit Choudhary
Asmit Choudhary - avatar
+ 2
Check this: https://code.sololearn.com/c7ald8PLgmci/?ref=app Output: B LL UUU EEEE JJJJJ
6th Jul 2022, 1:06 PM
SomeAwesome
SomeAwesome - avatar
6th Jul 2022, 12:54 PM
Asmit Choudhary
Asmit Choudhary - avatar
0
Lisa agreed. Asmit Choudhary it is expected that you post the code how you attempt to solve it, or explain where you are stuck. We can guide you, but you should not expect a complete solution from other people. This is for your own benefit, Sololearn is a self learning platform.
6th Jul 2022, 12:43 PM
Tibor Santa
Tibor Santa - avatar
0
Asmit Choudhary Your code is almost perfect. Just need to change the inner loop like this, so that the letter in each row is repeated as many times as the row number. for(int j=0;j<=i;j++)
6th Jul 2022, 12:58 PM
Tibor Santa
Tibor Santa - avatar
0
Also remember to replace the test string with the user input (you haven't used the scanner yet)
6th Jul 2022, 1:04 PM
Lisa
Lisa - avatar
- 1
You just posted the same question and received an approach? Please follow this approach and then show your code attempt. If you want to add or clarify something, please post in your thread. Tibor Santa You see the issue?
6th Jul 2022, 12:39 PM
Lisa
Lisa - avatar