java tutorials

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.

Buzz Number Program in Java

A number is said to be Buzz Number if it ends with 7 or is divisible by 7.
Example: 1007 is a Buzz Number.

Automorphic Number Program in Java

An Automorphic number is a number whose square “ends” in the same digits as the number itself.
Examples: 5*5 = 25, 6*6 = 36, 25*25 = 625

Armstrong Number Program in Java

Armstrong Number is a positive number if it is equal to the sum of cubes of its digits is called Armstrong number and if its sum is not equal to the number then its not a Armstrong number. Armstrong Number Program is very popular in java, c language, python etc. Examples: 153 is Armstrong, (1*1*1)+(5*5*5)+(3*3*3) = 153

Java Operators Program in Java

Java Operators Program in Java

1 6 7 8 9 10 12