Validate An Odd Or Even Number In Ruby
Join the DZone community and get the full member experience.Join For Free
Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.
x%2 == 0 ? true : false x = 5 x%2 == 0 ? true : false #=> false x = 8 x%2 == 0 ? true : false #=> true