Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^5: How to split an integer??

by McDarren (Abbot)
on Dec 06, 2012 at 11:28 UTC ( #1007538=note: print w/ replies, xml ) Need Help??


in reply to Re^4: How to split an integer??
in thread How to split an integer??

my $number = 23; my @bits = split //, $number; my $total; for my $bit (@bits) { $total += $bit; } print "Number=$number Total=$total\n";


Comment on Re^5: How to split an integer??
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-08-29 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (275 votes), past polls