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

Launching an app doesn’t need to be daunting. Whether you’re just getting started or need a refresher on mobile app testing best practices, this guide is your resource! Brought to you in partnership with Perfecto


x%2 == 0 ? true : false

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

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


Keep up with the latest DevTest Jargon with the latest Mobile DevTest Dictionary. Brought to you in partnership with Perfecto.

Topics:
ruby

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}