Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Problem Domains and Multiple Disciplines

by Velaki (Chaplain)
on Aug 30, 2004 at 14:22 UTC ( #386925=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    
    ...
    $sum += $_ for 1 .. $n;
    
    print "$sum\n";
    
  2. or download this
    Sum(1..n) = n(n+1)/2
    
  3. or download this
    #!/usr/bin/perl -w
    
    ...
    my $sum = $n * ( $n + 1 ) / 2;
    
    print "$sum\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://386925]
Approved by ccn
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2021-02-27 19:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?