abhishekdoifode1 / Hacktoberfest2021

This Repo is created by Abhishek for the beginners to promote open source programming (hacktoberfest), you just need to add any type of code in any programing lang you want, just commit your name at the end. Give a Star⭐
130 stars 665 forks source link

Create EvilNo.java #1002

Open AyanMahato opened 2 years ago

AyanMahato commented 2 years ago

The Evil number is another special positive whole number in Java that has an even number of 1's in its binary equivalent. Unlike Prime and Armstrong numbers, Evil number is not so popular and asked by the interviewers.

The numbers which are not evil are called odious numbers. Let's some examples of evil and odious numbers.

15 is an evil number because in its binary equivalent, i.e., 1111, it has an even number of ones. 16 is an odious number because in its binary equivalent, i.e., 10000 has not even number of ones 23 is also an evil number because it has an even number of ones in its binary equivalent, i.e., 10111.