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 :

How to end for loop without new line? My code is like

But i got:

this: for (int p = 0, i = 0; i Assume S=5,

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.

My expectation is : But i got: with a new line at

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!