Recent Posts

Java program to swap two numbers without using a third variable

Here are 4 Tricks to swap two numbers without using a third variable. Here is a java program to swap two numbers without using a third variable. To do so you can use basic mathematical operations like multiplication, division and addition, subtraction. See the Further Explanation:  Incoming terms: tricks to swap two numbers, swap two numbers various tricks.

Read More »

Java program to print the magic number series

This is a Java program to print the Magic number series. However before starting let me tell you what is a magic number. A Magic number is a number whose sum of digits eventually leads to 1. Example#1:  19 ;  1+9 =10 ; 1+0 = 1.  Hence a magic number. Example#2:  224; 2+2+4=10; 1+0 =1.  Hence a magic number. Example#3:  874; ...

Read More »

Java program to print happy numbers for a given range

This is a Java program to print happy numbers for a given range. But what is a happy number? A number whose sum of the square of digits is ultimatly equal to 1 is a happy number. By ultimately we mean that starting with any positive number we continue the addition of square of digits till we get a single digit number ...

Read More »