Java Numbers Intermediate Programs

Master fundamental Java concepts with these beginner-friendly programs

Count Digits Without String Conversion

Count the number of digits in a number without using string conversion.

Digital Root

Repeatedly sum digits of a number until a single digit remains.

Harshad Number Check

Check whether a number is divisible by the sum of its digits.

LCM Using GCD

Find the Least Common Multiple (LCM) of two numbers using GCD.

Trailing Zeroes in Factorial

Count the number of trailing zeroes in the factorial of a number.

Reverse Number

Reverse a number without converting it to a string or using arrays.

Armstrong Number

Check if a number is an Armstrong number.

Sum of First N Primes

Find the sum of the first N prime numbers.

GCD of Array

Find the GCD of elements in an array.

Count Total Factors

Write a program to count the number of factors of a number.

Palindrome Number Check

Write a program to check if a number is a palindrome.

Decimal to Binary

Convert a decimal number to binary without using built-in methods.

Sum of Two Squares

Check if a number can be expressed as the sum of two square numbers.

Sieve of Eratosthenes

Generate all prime numbers up to N using Sieve of Eratosthenes.

Digits That Divide the Number

Count digits of a number that divide it completely.

Power of Number Using Recursion

Write a recursive function to calculate ab.

Largest Prime Factor

Write a program to find the largest prime factor of a number.

Perfect Square Check (Binary Search)

Check whether a number is a perfect square using binary search.

Nearest Palindrome Number

Find the nearest palindrome to a given number.

Count Set Bits in Binary Representation

Count the number of 1s in the binary representation of a number.