View Single Post
  #10 (permalink)  
Old 12-05-2007, 08:32 AM
siLenTz's Avatar
siLenTz siLenTz is offline
Jr. Programmer
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Posts: 87
iTrader: (0)
siLenTz will become famous soon enoughsiLenTz will become famous soon enough
I was surprised because you didn't know how to make it shape like Pyramid.
It's not hard; you only need to create one loop for print repeated tabs.
For example: I want to print 5 rows of Pascal Triangle. In this case, for the
first row I would print 5 tabs; for the second row, I will print 4 tabs.; and so on.
And each number will be 2 tabs distance from each other.
Here my output concept: (___ represent for tab)

___ ___ ___ ___ ___ 1
___ ___ ___ ___ 1__ ___ 1
___ ___ ___ 1__ ___ 2__ ___ 1
___ ___ 1__ ___ 3__ ___ 3__ ___ 1
___ 1__ ___ 4__ ___ 6__ ___ 4__ ___1

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote
The Following User Says Thank You to siLenTz For This Useful Post:
HelloWorld (12-05-2007)