I have figured out that every row has an odd no. of items but can’t understand how the flow is going in each column and how is does column gets incremented in each row.
Couldn't find the working of columns
which question you are talking about
plz mention the question as well or ask doubt below that question so that we can see the question
Pseudocode Assignment
Pseudocodes
Write pseudocode to print the following pattern
1
232
34543
4567654
567898765
is this is the question
or there are some space in front as well
no this is the question
Logic:
-
make a loop that cover rows as :
int i=1;i<=n;i++
-
use another loop inside the above loop that goes from " i " to " (2*i-1) " and print " j " as :
for(j=i;j<=(2*i-1);j++)
cout<< j;
this loop print increasing numbers in a particular row
- now make another loop that print decreasing numbers.
For Reference :
for(int i=1;i<=n;i++)
{
int j;
for(j=i;j<=(2*(i)-1);j++)
{
cout<<j;
}
j-=2;
for(;j>=i;j–)
cout<<j;cout<<"\n";
}
first try to implement on your own then use code given below.
Code:
If you have further doubt feel free to ask
okay thank for the help
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
if you have further doubt in this quest. then feel free to ask here.