Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Check even numbers?

by liverpole (Monsignor)
on Aug 06, 2006 at 22:12 UTC ( [id://565872]=note: print w/replies, xml ) Need Help??


in reply to Check even numbers?

A very simple method for checking whether a number $N is odd or even is to ask yourself "is there any remainder when I divide $N by 2?".

So, for example:

if (0 == $N % 2) { print "The number $N is even\n"; # There is no remainder } else { print "The number $N is odd\n"; # There is a remainder (of 1) }

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2025-01-17 03:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (55 votes). Check out past polls.