If i give any number, the output's rows are less than that number. Why? | Sololearn: Learn to code for FREE!

0

If i give any number, the output's rows are less than that number. Why?

https://code.sololearn.com/cXP5CR93gV5C/?ref=app

c

3/28/2021 5:47:21 AM

Jawa

5 Answers

New Answer

+1

It's because you increment i on line 18, which you don't need to do as i as incremented automatically as set by the for loop (line 8). This means that you're incremented i twice for each loop, so you get fewer lines than you are expecting.

+1

The amount of rows depends on the input. So I need to know what did you input to get the 5 rows.

+1

M. Jawahirullah are you trying to make a Floyd triangle?

+1

Thank u Russ

0

No problem! Happy coding!