Add an if condition for the for loop and endl output that checks if counter is odd.
If(counter%2)
Do not include counter-- in if block
As for the descending part, before running the while loop, decrement counter by 1 otherwise you will get two lines of seven *.
In the while loop, use counter>0, then add the if statement to check for odd number.
Then. In the for loop use x=counter-1;x>=0;x--
What you r currently doing in the for loop is assignong value 0 to x then decrementing it on every iteration and checking if it is greater than a positive num which will never happen, thus resulting in an infinite loop..
English
-
[spoiler]The if condition will currently give you even numbers. To get odd numbers you just append something to the existing statement. I'll let you figure that out yourself..[/spoiler]