Hello,
I want to draw this type of shape by asterisks using FOR nested loops.
-------*
------**
-----***
----****
---*****
On the left side, "------" these are spaces.
Hello,
I want to draw this type of shape by asterisks using FOR nested loops.
-------*
------**
-----***
----****
---*****
On the left side, "------" these are spaces.
What is your idea and have you tried?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I have tried a lot but wrong output
Right, so what did you try? What algorithm were you trying to implement?
If you find this problem too hard, try solving it without the spaces, e.g., print shapes of the form:
Code:* ** *** ****
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
But it is possible bcoz it is a task given to me but i didnt know how to solve this problem.
Sure, it's possible. Your teacher clearly isn't expecting you to achieve the impossible.
Laserlight has made a suggestion on how you might break the problem into smaller parts, that may be solved more easily.
Beyond that, try describing how you would go about addressing the problem (or sub-problems if you follow laserlight's suggestion). Just saying you don't know won't work here, because we know enough to realise that you will learn nothing if we just give you the answer before there is evidence of effort by YOU.