Pascal triangle

hoda's Avatar, Join Date: Feb 2009
Go4Expert Member
somebody help me!! i didnt understand C++ completely and now i have to give my homework to the teacher.I need the answers for emergency.please help me to answer these questions:
1-make a program that take one number and print this picture in the middle of the page:
for example :4 *
* *
* * *
* * * *
first star should be printed in the forteenth column.
2-make a program that unscramble the accepted number. for example :16482:12468
hoda's Avatar, Join Date: Feb 2009
Go4Expert Member
*
* *
* * *
* * * *
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
hoda, please do not jump into any article with your homework help and try creating a new thread for your query with proper explanation of what you have tried and where you are stuck.
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
We don't do homework, sorry. We'll help you learn though.
How far have you got with your programs?
Can you see what needs doing in terms of what loop(s) may be needed?

It's useful to break it down into easier tasks; that's how I solve complicated problems. So for example I might start with a program that just displays 5 asterisks in a line (using a loop, not cheating with a single printf). Then I might adjust that to print any number of asterisks in a line.
Then you need to modify it to print multiple lines up to a fixed number.
Then it's just a case of getting that number from the user.

For 2 that's just a simple sort routine.

You'll probably have everything you need in the course notes you've got so far. Relax, don't panic, and let us know where you get stuck.
hoda's Avatar, Join Date: Feb 2009
Go4Expert Member
thanks for your guidance