Hi all,
I need to write pseudo-codes for these 2 patterns.
I did execute the program in C++,it displays it like:
*
**
***
****
*****
******
but I am unable to display where there are the same amount of asterisks, I highlight them in red. I am unable to make it work well where the same amount of asterisks is being repeated on the 2 rows.
I am placing my pseudocodes too.
The pattern has the following format:
1.
*
**
***
****
****
******
*******
2.
*******
******
*****
*****
****
***
**
*
Pseudo:
1. For the ascending pattern:
declare variables x,y,a as integers
read a
for x=0 to a increment x by 1
begin
for y=0 to x increment y by 1
begin
display "*"
end for
end for
2. For the descending pattern:
declare variables x,y,a as integers
read a
for x=0 to a-1 decrement x by 1
begin
for y=0 to x increment y by 1
begin
display "*"
end for
end for
Plz I would like to have some suggestions to what I post..
I am in a hurry to fix it.
Thanks