Question: How to end for loop without new line? My code is like this: for (int p = 0, i = 0; i Assume S=5, My
How to end for loop without new line?
My code is like this:
for (int p = 0, i = 0; i
Assume S=5,
My expectation is :

But i got:

with a new line at the bottom of the output.
Similar to the reversed triangle,
My code is like this:
for (int i = 1, k = 0; i
My expectation is this, without the extra space at the first line, which only have one star.

How can I solve this problem and can you please correct the c++ code for me? thank you
Transcribed image text
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
