learn java

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

Voting Age Program in Java

A person can votes if age is greater than or equal to 18.

1 7 8 9 10 11 13