## Java Code to find Greatest Common Divisor (GCD) using recursion / loop

Greatest Common Divisor (GCD) or Greatest Common Factor (GCF), is the largest positive integer which divides both numbers. For example, consider 12, …

Greatest Common Divisor (GCD) or Greatest Common Factor (GCF), is the largest positive integer which divides both numbers. For example, consider 12, …

There are many ways to reverse a string in Java. The following two programs show that how to reverse a string using java …

A number is called perfect number, if the number is equal to the sum of all of its factors except itself. For …

The following java program finds the Prime Factors of a given number. Suppose given number is n= 15, the following steps shows …

Find & replace of a word in a line of string can be done in several ways. Already String class have methods replace …

/* Searching an element in ArrayList without using “contains(Object elem)”, “indexOf(Object elem)” methods can be done by traversing the array list until …

The following java code prints Pascal Triangle in format. In Pascal’s triangle, each number is calculated by adding the two numbers directly …

/* Sum of 1 to N natural numbers can be calculated using for / while loop very easily. In the below java program …

For Soring the Array of Strings, Simply we can use the sort method of Arrays class. Or we can write algorithm to …

This is a generalized and portable program for converting Number to Words. This program is capable of converting any big number by doing …