• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Study Abroad
  • Writing Services
  • About Us
  • Contact
  • Blog

AcademicsHQ

Instant access to Study Resources, 24/7 Homework Help, Tutors, to help you ace your homework.

homework help
  • Academic Writing
    • Dissertation Writing
    • Report Writing
  • Research Process
  • Referencing Guide
  • Resume Writing
Home » Blog » Armstrong Number (Programming Basics)

Armstrong Number (Programming Basics)

June 15, 2019 by academicshq Leave a Comment

What is an Armstrong Number?
The number for which the sum of its digits to power of number of its digits is equal to that number is known as an Armstrong Number.

For example, a numbers for which the sum of cube of its digits is equal to that number is an Armstrong number.
153 is such a number since 1 cubed 3 + 5 cubed 3 + 3 cubed 3 = 153.


GET INSTANT HELP FROM EXPERTS!

  • Looking for any kind of help on your academic work (essay, assignment, project)?
  • Want us to review, proofread or tidy up your work?
  • Want a helping hand so that you can focus on the more important tasks?

Hire us as project guide/assistant. Contact us for more information


Another example is 1634.
Total digits in 1634 is 4.
And 1 to the power of 4 + 6 to the power of 4 + 3 to the power of 4 + 4 to the power of 4 = 1634.

More examples of Armstrong numbers:
1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 372, 407, 1634, 8208, 9474, 54748, 92727, 93084, 548834, 1741725

A positive integer of n digits is called an Armstrong number of order n (order is number of digits) if.
abcd… = pow(a,n) + pow(b,n) + pow(c,n) + pow(d,n) + ….

Write a Computer Program:
Write a program to check whether the entered number is Armstrong or not.

Example 1: Check Armstrong Number for 3 digit number
public class Armstrong {

public static void main(String[] args) {

int number = 371, originalNumber, remainder, result = 0;

originalNumber = number;

while (originalNumber != 0)
{
remainder = originalNumber % 10;
result += Math.pow(remainder, 3);
originalNumber /= 10;
}

if(result == number)
System.out.println(number + ” is an Armstrong number.”);
else
System.out.println(number + ” is not an Armstrong number.”);
}
}

Filed Under: Computers

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Primary Sidebar

Recent Posts

  • Hindi Project Work: Hindi Pariyojana Karya (हिंदी परियोजना कार्य)
  • Geography Projects Class 10
  • Money Education for Kids: Teach Them Financial Responsibility
  • Bachelor of Management Studies (BMS): Project Work
  • BMS (Bachelor of Management Studies): Assignment & Project Topics

Categories

  • Black Book Projects
  • Book Reviews
  • Business Law
  • CBSE Study Notes
  • Computers
  • Digital Business
  • Economics
  • Education Articles
  • English Literature
  • Environmental
  • Essays
  • Foreign Education
  • General
  • Geography
  • German
  • Global Education
  • Hindi
  • History
  • Hotel Management
  • HRM
  • Jobs
  • Management
  • Management Notes
  • Math
  • Media Study Notes
  • Movie Reviews
  • Primary
  • Research
  • Sample Essays
  • School Projects
  • School Study Notes
  • Science
  • Self Improvement
  • Services
  • Social Studies
  • Sociology
  • Solved Assignments
  • Student Software
  • Uncategorized
  • Writing Tips

Footer

CLASS NOTES

  • Class 10 . Class 9
  • Class 8 . Class 7
  • Class 6 . Class 5
  • Class 4 . Class 2
  • Class 2 . Class 1

ACADEMIC HELP

  • Essay Writing
  • Assignment Writing
  • Dissertation Writing
  • Thesis Writing
  • Capstone Projects
  • Homework Help
  • Report Writing

SERVICES

  • Writing Services
  • Book Review
  • Ghost Writing
  • Make Resume/CV

ABOUT US

  • About Us
  • Contact
  • Privacy Policy
  • Blog

Copyright © 2025 · News Pro on Genesis Framework · WordPress · Log in