12,289,383 members (74,481 online)
Rate this:
See more:
Hello, could you help me this please!

1.(1st program) Print to screen a triangle with this require: The "n"th row consists of n elements of Fibinacci sequence.
(I'm successfuly print the Fibonacci but do not know how to print it as a triangle)
2.(2nd program) Print to screen the Pascal Triangle...
(Really get stuck with this..know only the logic but can't find the algorithm to solve)

Please only use loop, condition,......i only know these!! (Beginer)

Thank you very much!!!!
Posted 27-Sep-12 2:21am
Edited 27-Sep-12 2:45am
v3
Legor 27-Sep-12 8:25am

No, we dont do other peoples homework. But we are willing to help if you have specific problems.
Minh Hikari 27-Sep-12 8:41am

Yes. Sorry because i haven't said. I can print the Fibonacci, but don't know how to print it as an triangle.....that's the problem i'm having now....wait for me to edit the quesion.
Legor 27-Sep-12 9:05am

Please do not use !!! after each sentence. It's called shouting in internet terms so when reading your messages one gets the feeling he is shouted at all the time which isn't very polite now is it?
Minh Hikari 27-Sep-12 9:11am

oh. I don't know that.....thank you very much for telling me.

Rate this:

## Solution 1

Have a look at this[^].
Or you could have googled it.

BTW no one would work for you for free. As its your homework, do it yourself. As you said, you are beginner, start with small programs like printing normal number sequence, then advance through step by step. Post the question if you are stuck with some code or logic, you'll definitely get help then.

All the best.
Minh Hikari 27-Sep-12 8:37am

yes.tks... I have successfully with the Fibonacci...but don't know how to print it as a triangle....I "Goggled" it and can't find the solution. That's the problem....
Malli_S 27-Sep-12 8:39am

Print spaces before digits to format it.
_ _ _ 1
_ _ 2 1 2
_ 3 2 1 2 3

In above stuff, '_' represents the space. Now did you get any clue? Try it.
Minh Hikari 27-Sep-12 8:48am

uh!!! let's see.....this format.

1
1 1
1 1 2
1 1 2 3
1 1 2 3 5
1 1 2 3 5 8
1 1 2 3 5 8 13
.............

like that!!!
Rate this:

v2
Rate this:

## Solution 3

You could write a LineCenter Function to print out.

For Example:

bool LineCenter(char *text, int maxlinelen);

Top Experts
Last 24hrsThis month
 OriginalGriff 408 KARTHIK Bangalore 305 Dave Kreskowiak 175 F-ES Sitecore 140 ppolymorphe 139
 OriginalGriff 7,960 ppolymorphe 4,897 CHill60 4,870 Sergey Alexandrovich Kryukov 4,239 KARTHIK Bangalore 4,067