Hello Karen,
compile and run this code. You'll get what you want.
Edited to remove code. We don't approve of handing out complete code as answers to questions here, as that isn't a good way for the posters to learn anything. (Paul C - moderator)
You appear to have got the first half to work. Now, the second half is the first half backwards. Remember you can iterate an array like this:-
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Karen Barlow wrote:
Hello Karen,
compile and run this code. You'll get what you want.
Edited to remove code. We don't approve of handing out complete code as answers to questions here, as that isn't a good way for the posters to learn anything. (Paul C - moderator)
Not too sure what you mean by this... First of all, when I compile and run this I do not get the final result I want. Second of all, I was not requesting anyone to hand out complete codes as answers, hence why I tried to work through it. I was just inquiring for some insight/guidance!!
the original post by Sankalp Bhagat had the complete solution posted. The staff prefers people not do that, so when we see it, we tend to edit the post to remove it. That's why it looks a bit strange to you.
That is because you are printing both inside the same loop. You need one loop to go up and one to come down. At least that is probably the simplest way to do it.Karen Barlow wrote:. . . The two patterns appear to overlap . . .
Karen Barlow wrote:
Karen Barlow wrote:
Hello Karen,
compile and run this code. You'll get what you want.
Edited to remove code. We don't approve of handing out complete code as answers to questions here, as that isn't a good way for the posters to learn anything. (Paul C - moderator)
Not too sure what you mean by this... First of all, when I compile and run this I do not get the final result I want. Second of all, I was not requesting anyone to hand out complete codes as answers, hence why I tried to work through it. I was just inquiring for some insight/guidance!!
I child proofed my house but they still get in. Distract them with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|