function isEvenOdd(num):String {
if ((num % 2) == 0) {
return "even";
} else {
return "odd";
}
}
trace(isEvenOdd(2)); //Outputs even
trace(isEvenOdd(7)); //Outputs odd
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
Determine Whether Number is Even or Odd
Posted by
admin
on Wednesday, August 12, 2009
Labels:
Number
0 comments:
Post a Comment