Yes, of course, but then I can tell you that the answer is basically the same as the code in the first postOriginally Posted by rushhour
Let's see what you have tried.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Well I know it needs to be reversed somehow so that it prints fewer spaces in the first loop and more spaces towards the end of the loop. And the second loop to print more * in the beginning and less * towards the end of the loop. Im just having difficulty reversing it.
Think of a formula that relates the number of spaces and the number of stars on each line. For example, does the sum of the number of spaces and number of stars per line ever change?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Last edited by rushhour; 11-27-2008 at 03:02 PM. Reason: added second loop
I have not checked if your formulae are correct, but yes, you are on the* right track since (n-i) in the second loop causes its number of iterations to decrease and i increases.
* or I should say a right track, since there are other possibilities.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
you're stuck because you didn't put in any effort to actually learn what you're supposed to be learning.
If you had you'd have had no trouble whatsoever writing a correctly working program on your own rather than scouring some book or website, finding something that looks similar to what you're supposed to do, and beg on some other website for people to "fix" it for you.
With that attitude you'll never make it as a developer, but you might make it as a project manager.