Please register or login. There are 0 registered and 1408 anonymous users currently online. Current bandwidth usage: 2534.85 kbit/s November 23 - 07:38am EST 
Hardware Analysis
      
Forums Product Prices
  Contents 
 
 

  Latest Topics 
 

More >>
 

    
 
 

  You Are Here: 
 
/ Forums / Programming /
 

  Floyd's triangle 
 
 Author 
 Date Written 
 Tools 
Captain Jack Sparrow Apr 09, 2006, 02:21am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List Replies: 13 - Views: 3425
How do i build a floyd's triangle in C?

Floyd's triangle is this:

1
23
456
78910
1112131415
.......

Please give code or logic



*Raid on to the Black Pearl my friends*
Savvy!
Want to enjoy less advertisements and more features? Click here to become a Hardware Analysis registered user.
Shadow_Ops_Airman1 Apr 09, 2006, 03:00am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
what you want it in Binary or hexadecimal?

AMD Athlon XP-M 2500+ (133x14= 1867MHz) (209x11= 2299MHz)
DFI LP NF2 Ultra-B (Hellfire 3EG Rev2)
Antec SX800, Neo HE 500, 4 Antec 8CM Fans
Thermalright SI-97 1 Antec Tricool 12CM Fan
CL SB XFi Xtreme Music
2x Barracuda HDs (250/400)
2x Samsung Write
Captain Jack Sparrow Apr 09, 2006, 03:27am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
Both actually.

Whats the difference in the codes though?

*Raid on to the Black Pearl my friends*
Savvy!
Shadow_Ops_Airman1 Apr 09, 2006, 03:46am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List

Edited: Apr 09, 2006, 03:52am EDT

 
>> Re: Floyd's triangle
Hexadecimal requires only 1/4 of the characters of binary to create, Hexacecimal uses 16 characters, 0-9 and A-F PS are those Individual Characters or whole numbers

AMD Athlon XP-M 2500+ (133x14= 1867MHz) (209x11= 2299MHz)
DFI LP NF2 Ultra-B (Hellfire 3EG Rev2)
Antec SX800, Neo HE 500, 4 Antec 8CM Fans
Thermalright SI-97 1 Antec Tricool 12CM Fan
CL SB XFi Xtreme Music
2x Barracuda HDs (250/400)
2x Samsung Write
tara thakpa Sep 03, 2007, 09:30pm EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
code 4 floyd triangle:

main void()
{
int no;line_no=1;
printf("enter a number");
scanf("\n");
while(line_no<=n)
{
cnt=1
while(cnt<=line_no)
{
printf("%d \t",no++);
cnt++;
}
printf("\n")
line_no++
}
}

Bala krishnan Sep 30, 2009, 03:07am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
I want the coding for the following format

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

please send the coding to my mail id
krishs.bala@gmail.com

Plug & Play Sep 30, 2009, 07:56am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle

I want a busty how with great "Assets" but it aint gonna happen now is it.....savvy!

COMPUTERS ARE NOT JUST MY LIFE...THEY ARE MUCH MORE IMPORTANT THEN THAT.
GO SELL CRAZY SOMEWHERE ELSE....WE'RE ALL STOCKED UP HERE!!!!!!
McFly Sep 30, 2009, 04:42pm EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List

Edited: Sep 30, 2009, 04:46pm EDT

 
>> Re: Floyd's triangle
Bala krishnan (92386) said on Sep 30, 2009 at 12:07am PDT:
I want the coding for the following format

That's Pascal's Triangle: http://en.wikipedia.org/wiki/Pascal%27s_triangle

I just whipped this C code up for it: http://hardwareanalysis.com.pastebin.com/f3ca21fd8

Sample output:
Pascal's Triangle, first 8 rows

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1


The number of rows it calculates is hardcoded, but you could make it a parameter (eg. pascals.exe -rows 12).
Seems to work well, but I doubt it's the most efficient way.


EliteBook Fund: 17.5% completehttp://s215.photobucket.com/albums/cc221/mmkfly • Xfire: mcfly2000
COMPOUND: Acer Aspire 4720-4538 | 14.1" WXGA | Intel T2390 | 3GB G.SKILL | 400GB WD Scorpio Blue | Windows 7 Ultimate x64
Shawn Langley Sep 30, 2009, 04:56pm EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
Mr Fly would you mind whipping me up the source for the next greatest OS to be created and pass it of as my own? ;)

"Stephen Hawking, Usher, the Sugar Puffs Monster and the Wu Tang Clan.....welcome to operation MINDF*CK!"
McFly Sep 30, 2009, 04:58pm EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
toDo = Shawn.readThought();
executeAction(toDo);

^_^


EliteBook Fund: 17.5% completehttp://s215.photobucket.com/albums/cc221/mmkfly • Xfire: mcfly2000
COMPOUND: Acer Aspire 4720-4538 | 14.1" WXGA | Intel T2390 | 3GB G.SKILL | 400GB WD Scorpio Blue | Windows 7 Ultimate x64
Meats_Of_Evil Oct 01, 2009, 01:31am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
Damn McFly! And all this time I thought you only sat on your laptop and made grease monkeyscripts for us lmao!

Speaking of which... anything new ?

-------------------------------------------------------------------------------------------------------------------------
Major Dieter Hellstrom: "That was the sound of my Walther pointed right at your testicles."
Plug & Play Oct 01, 2009, 10:24am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle


Ha, so did I. I bet you got little round john lennon type glasses and a white doctors coat on right now McFly.


HHEHE

COMPUTERS ARE NOT JUST MY LIFE...THEY ARE MUCH MORE IMPORTANT THEN THAT.
GO SELL CRAZY SOMEWHERE ELSE....WE'RE ALL STOCKED UP HERE!!!!!!
McFly Oct 01, 2009, 10:56am EDT Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
Meats_Of_Evil (57359) said on Sep 30, 2009 at 10:31pm PDT:
Damn McFly! And all this time I thought you only sat on your laptop and made grease monkeyscripts for us lmao!

^_^

Plug & Play (62078) said on Oct 01, 2009 at 07:24am PDT:
Ha, so did I. I bet you got little round john lennon type glasses and a white doctors coat on right now McFly.

Well, I've never done this before, but here's a picture of me:
http://img504.imageshack.us/img504/4172/mcfly.jpg


EliteBook Fund: 17.5% completehttp://s215.photobucket.com/albums/cc221/mmkfly • Xfire: mcfly2000
COMPOUND: Acer Aspire 4720-4538 | 14.1" WXGA | Intel T2390 | 3GB G.SKILL | 400GB WD Scorpio Blue | Windows 7 Ultimate x64
Xhan Mehmeti Nov 09, 2009, 08:49am EST Reply - Quote - Report Abuse
Private Message - Add to Buddy List  
>> Re: Floyd's triangle
can you do that , not for numbers , but if a sentence is given, how you can write it in floyd's triangle ,

P
LE
ASE
HELP
ME+++

and in the end if there is a gap of word, i should fill it with '+' , Can you help please


Write a Reply >>


 

    
 
 

  Topic Tools 
 
RSS UpdatesRSS Updates
 

  Related Articles 
 
 

  Newsletter 
 
A weekly newsletter featuring an editorial and a roundup of the latest articles, news and other interesting topics.

Please enter your email address below and click Subscribe.