- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Armstrong number in Java.
Following is the required program.
public class Tester { public static void main(String[] args) { int c = 0, a, temp; int m = 153; int n = m; temp = n; while (n > 0) { a = n % 10; n = n / 10; c = c + (a * a * a); } if (temp == c) System.out.println(m + " is an armstrong number"); else System.out.println(m + "is not an armstrong number"); } }
Output
153 is an armstrong number
- Related Articles
- Java Program to Check Armstrong Number
- Armstrong Number in Python
- Java Program to Check Armstrong Number between Two Integers
- Java Program to Display Armstrong Number Between Two Intervals
- Java program to check whether the given number is an Armstrong number
- Armstrong number within a range in JavaScript
- C++ Program to Check Armstrong Number
- Python Program to Check Armstrong Number
- C Program to Check Armstrong Number?
- Swift Program to Check Armstrong Number
- Haskell Program to Check Armstrong Number
- Golang Program to Check For Armstrong Number
- How to Find Armstrong Number in an Interval using Python?
- How to Check Armstrong Number between Two Integers in Golang?
- C++ Program to Display Armstrong Number Between Two Intervals

Advertisements