Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Armstrong_number.java #219

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Swyom
Copy link

@Swyom Swyom commented Oct 14, 2024

This Java program checks whether a given number is an Armstrong number. An Armstrong number (or Narcissistic number) is a number that equals the sum of its digits each raised to the power of the number of digits. The program includes:

1.A method to calculate the power of a digit.
2.A method to determine the number of digits (order) of the number.
3.Logic to check if the sum of the powered digits equals the original number.
Tested with example values like 153 (Armstrong) and 1253 (non-Armstrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants