How to count frequency of digits in a given number in java / Java program to count the number of times each digit occurs in a number

This problem is pretty common in interviews and computer examinations. Candidate is required to 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,

(more…)

Continue Reading

How to check Pronic number in java / Program to check for Pronic number in java

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.

(more…)

Continue Reading

How to convert decimal number to binary in java / Various ways to convert decimal number to binary in java

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.

(more…)

Continue Reading

How to divide two numbers without using division (/) operator in java / How to find remainder of division of two numbers using minus (-) operator / Java program to find remainder of division using –

Suppose you want to divide a number a by another number b in java, you will use a / b. So simple, isn’t it. But what if you are required to determine the result by using only minus(-) operator, that is, without using division (/) operator. (more…)

Continue Reading

How to convert binary number to decimal in java

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 binary number can be converted to a decimal number in java. (more…)

Continue Reading
Close Menu

Never Miss an article !

Get the new post delivered straight into your inbox, enter your email and hit the button

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

codippa will use the information you provide on this form to be in touch with you and to provide updates and marketing.