Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

[Solved] How to check if a Given Number is Binary in Java? Example

Today we will take a look at another simple programming exercise, write a program to check if a Number is binary in Java. A number is said to be binary if it only contains either 0 or 1, for example, 1010 is a binary number but 1234 is not. You can not any library method to solve this problem, you need to write a function to check if the given number is binary, you can use basic constructs of Java programming language e.g. operators, keywords, control statements, etc. If you are a regular reader of Javarevisited, then you know that I love to share simple programming problems here.


This post first appeared on Javarevisited: Blog About Java Programmin, please read the originial post: here

Share the post

[Solved] How to check if a Given Number is Binary in Java? Example

×

Subscribe to Javarevisited: Blog About Java Programmin

Get updates delivered right to your inbox!

Thank you for your subscription

×