Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Validate An Odd Or Even Number In Ruby

DZone's Guide to

Validate An Odd Or Even Number In Ruby

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.


x%2 == 0 ? true : false

x = 5
x%2 == 0 ? true : false
#=> false

x = 8
x%2 == 0 ? true : false
#=> true


Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:
ruby

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}