You know, it would help if you included the output you are currently getting and also if there would be more meaningful variable-names in the code.
Because I have trouble following what the loops are doing. Or why there are 4.
I’d take one for the row, one for counting up, one for counting down. So that’s only 3, but somehow none of the loops is counting down.
There are a couple of tricks to use.
First off, call the input num_rows and have the first loop count up int row = 1.
This way the following code reference the term “row” for the row you are in - instead of the meaningless i.
Second, you are counting up from 1 to the current number of the row.
Third you count down from the current number of the row to 1.
You do not have to start a for-loop with 1. You don’t have to always increment (i++) but can also decrement (i–) in the loop.