String length | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

String length

If the string is Adam how can the output be M MM MM MMM (I think it is based on the string length)

26th Jan 2019, 5:07 PM
Altina
Altina - avatar
5 Respostas
26th Jan 2019, 7:41 PM
Denise RoƟberg
Denise RoƟberg - avatar
+ 2
What do you want the output to be, exactly? Also, in which language?
26th Jan 2019, 5:12 PM
Zen
Zen - avatar
+ 1
Yes you need the length. And I would use two loops. one for the row: for (int i = 0; i < length; i++){ //inside one for the line for (int j = 0; j < i; j++){ //print the chars } }
26th Jan 2019, 6:10 PM
Denise RoƟberg
Denise RoƟberg - avatar
+ 1
Thankyou so much šŸ˜
26th Jan 2019, 9:05 PM
Altina
Altina - avatar
0
Java language, thank you
26th Jan 2019, 6:56 PM
Altina
Altina - avatar