Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Pascal triangle (http://www.go4expert.com/forums/pascal-triangle-t16376/)

hoda 1Mar2009 02:35

Pascal triangle
 
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 1Mar2009 03:16

Re: C++ Tutorial I
 
*
* *
* * *
* * * *

shabbir 1Mar2009 09:08

Re: Pascal triangle
 
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 1Mar2009 21:10

Re: Pascal triangle
 
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 2Mar2009 01:21

Re: Pascal triangle
 
thanks for your guidance


All times are GMT +5.5. The time now is 14:58.