No such thing as a small change | |
PerlMonks |
Re: modulus questionby vinoth.ree (Monsignor) |
on Feb 03, 2015 at 05:50 UTC ( [id://1115341]=note: print w/replies, xml ) | Need Help?? |
To check if a number $day is divisible by divisor(3), use the modulus operator, %: If the number divisible by 3 then the modulus will return remainder 0, so the if condition will fail so add your logic in else condition. (OR) Even you can use the same as your if(($day%3) == 0) condition of checking the reminder is equal to 0. In this case you can add your logic in if(..) itself All is well
In Section
Seekers of Perl Wisdom
|
|