Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CGimmeCodeHomework
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) Big Grin | :-D
 
Thank you very much!!!!
Posted 27-Sep-12 2:21am
Edited 27-Sep-12 2:45am
v3
Comments
Legor at 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 at 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 at 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 at 27-Sep-12 9:11am
   
oh. I don't know that.....thank you very much for telling me.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You could write a LineCenter Function to print out.
 
For Example:
 
bool LineCenter(char *text, int maxlinelen);
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

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.
  Permalink  
Comments
Minh Hikari at 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 at 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 at 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!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 545
1 Dnyaneshwar@Pune 500
2 ravikhoda 325
3 OriginalGriff 277
4 Damith Weerasinghe 265
0 Sergey Alexandrovich Kryukov 10,974
1 OriginalGriff 6,777
2 Peter Leow 4,785
3 Abhinav S 3,813
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web01 | 2.8.140421.2 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid