Java Program to Check Armstrong Number - The Coding Shala
Home >> Java Programs >> Armstrong Number
In this post, we will learn how to check if a given number is Armstrong Number in Java.
Java Program to Check Armstrong Number
A positive number is called Armstrong Number if the following equation is true:
ab...z = a^n + b^n + .... + z^n
Here, n is the number of digits in the number.
For example, let's take 3 digits Armstrong Number.
Output: Armstrong Number
153 = 1*1*1 + 5*5*5 + 3*3*3
= 1 + 125 + 27
Other Posts You May Like
- Java Program to Reverse a String using Recursion
- Java Program to Find the Sum of N numbers
- Java Program to Swap Two Numbers
- Java Program to Multiply Two Numbers
- Java Program to Find the Sum of Digits of a Number