java

Happy Number Program in Java

A happy number is a natural number in a given number base that eventually reaches 1 when iterated over the perfect digital invariant function for. Those numbers that do not end in 1 are -unhappy numbers.

Greatest Common Divisor Program in Java

the greatest common divisor (gcd) of two or more integers, which are not all zero, is the largest positive integer that divides each of the integers. For example, the gcd of 8 and 12 is 4.

Floyd Triangle Program in Java

Floyd Triangle Program in Java 1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

Fibonacci Series Program in Java

A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 0, 1, 1, 2, 3, 5, 8, etc.

Factors Program in Java

Factor a number or algebraic expression that divides another number or expression evenly—i.e., with no remainder. For example, 3 and 6 are factors of 12 because 12 ÷ 3 = 4 exactly and 12 ÷ 6 = 2 exactly. The other factors of 12 are 1, 2, 4, 6 and 12.
Factors of 12: 1, 2, 3, 4, 6, 12.

Factorial Program in Java

Factorial is the product of all positive integers less than or equal to n. Examples: 4! = 4 × 3 × 2 × 1 = 24

Duck Number Program in Java

A Duck number is a number which has zeroes present in it, but there should be no zero present in the beginning of the number. For example 3210

Digit to Word Program in Java

import java.util.Scanner; public class DigitToWord { public static void main(String[] args) { // TODO code application logic here int r, n, num; String digitWords = “”; Scanner sc = new Scanner(System.in); System.out.print(“Enter number=”); n = sc.nextInt(); num = n; while (num > 0) { r = num % 10; switch (r) { case 0: digitWords […]

CoPrime Numbers Program in Java

Two integers a and b are said to be relatively prime, mutually prime, or coprime if the only positive integer that divides both of them is 1. Example: 13 and 15 are co prime.

Circular Prime Program in Java

A circular prime is a prime number with the property that the number generated at each intermediate step when cyclically permuting its digits will be prime. For example, 1193 is a circular prime, since 1931, 9311 and 3119 all are also prime.

1 6 7 8 9 10 12