## How to swap two strings without using third variable in java / How to swap two strings without using a temporary variable in java

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…

## How to check for a Palindrome string using stack in java / Java program to find Palindrome of a string using stack

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…

## 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,

## 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.

## How to calculate GCD in java / Various ways of GCD calculation in java / Java program to calculate GCD

What is GCD ?

GCD stands for Greatest Common Divisor. 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.

## How to check for an Evil number in java / Determine if a number is an Evil number

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.

## 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.

## 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…)

## 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…)

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.