Positive or Negative number:
Even or Odd number:
Sum of First N Natural numbers:
Example
Input: num = 5
Output: 15
Where first 8 number is 1, 2, 3, 4, 5
Sum of numbers = 1 + 2 + 3 + 4 + 5 = 15
Sum of N natural numbers:
Example
Input: 6
Output: 21
Explanation: 0 + 1 + 2 + 3 + 4 + 5 + 6 = 21.
Sum of numbers in a given range:
Greatest of two numbers:
Greatest of the Three numbers:
Leap year or not:
Prime number:
Prime number within a given range:
Sum of digits of a number:
Example
Input: 1234
Output: 1 + 2 + 3 + 4 = 10
Reverse of a number :
Example
Input: 123
Output: 321
Palindrome number:
Given an input integer as a number, the objective is to check whether or not the given
number integer is a Palindrome or not in Java Language. To do so we’ll reverse the the
number using the modulo and divide operators and check if the reversed number matches
the original number. Here are few methods to Check Whether or Not the Number is a
Palindrome
Example :
Enter number 121 revers
121 enter number and reverse number is match called palindrome number
Armstrong number :
Given an integer input, the objective is to check whether or not the number input
is an Armstrong number or not.
However, Armstrong number is any number following the given rule –
abcd… = an + bn + cn + dn + …
Where n is the order (length/digits in number)
Also check – Armstrong Number in a given Range in Java
Armstrong number in a given range :
Fibonacci Series up to Nth term :
Find the Nth Term of the Fibonacci Series :
Factorial of a number :
Power of a number :
Factor of a number :
Finding Prime Factors of a number :
Strong number :
Perfect number :
Perfect Square :
Automorphic number :
Harshad number :
Abundant number :
Friendly pair :