Friday , December 15 2017

Recent Posts

Java program to remove duplicate characters

Program to remove duplicate characters

Java program to remove duplicate characters or repeated character from a given string. Example: Thiiis is aa tessstt ssstring OUTPUT:  This is a test string Thus our motive is to remove repeated characters or duplicate characters from a given string. This is done by following concept. Step #1: select the starting character:   ch=str.charAt(0);    (hhhello) Step #2: Add the ...

Read More »

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 »