## How to check for a Duck number in java

Duck Number ? If a number contains one or more zeroes but does not start with a zero, it is called a Duck Number. Examples of Duck numbers are 2405,…

Duck Number ? If a number contains one or more zeroes but does not start with a zero, it is called a Duck Number. Examples of Duck numbers are 2405,…

What is Disarium Number? Consider a number such as 135. Its digits are 1, 3 and 5 with 1 at position 1, 3 at position 2 and 5 at position…

Problem Suppose there are 2 strings and their values need to be interchanged. String variables are declared as String stringOne = "This is "; String stringTwo = "codippa.com "; and…

A string is said to be Palindrome which when reversed is the same as original string. In other words, when a string and its reversed form are same, the string…

**write a program where a user enters any random integer and the program should display the digits and their count in the number**. For Example, if the entered number is 74526429492, then frequency of 7 is 1, 4 is 3, 5 is 1, 6 is 1, 2 is 3, 9 is 2. In tabular format,

**What is a Pronic Number ?**

A number which is the product of two consecutive numbers is a **Pronic Number**. Consecutive means the *numbers which come one after other when counted in ascending order* such as 2,3; 5,6; 98,99 and so on. Thus, a product of any two consecutive numbers is a Pronic number. **Example**, **12** is a product of 3 and 4 (consecutive numbers), thus it is a Pronic number. Other examples of Pronic numbers are **20** (product of 4 and 5), **42 **(product of 6 and 7), **72** (product of 8 and 9) and so on.

**What is GCD ?**

GCD stands for **G**reatest **C**ommon **D**ivisor. As its name suggests, a GCD of two or more numbers is the highest number that completely divides all those numbers. In other words, a number which divides two or more numbers with remainder as zero is called the GCD of those numbers.

Evil Number

A number which when converted to binary format has an even number of 1’s is an **Evil number.** An example of such number is 12. Binary equivalent of 12 is 1100. Number of 1’s = 2, an even number.

Overview

A binary number is a number which is composed of digits 1 and 0 such as 110011. A decimal number is a number which is composed of digits 0 to 9 such as 130672. It is a common requirement in computer programming to convert a binary number to decimal format and vice-versa. In this post, we will focus on different ways a decimal number can be converted to its equivalent binary number in java.