Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/merttalug/armstrongnumber
A program that finds whether a number between 0-1000 that it receives as input from users is an Armstrong number.
https://github.com/merttalug/armstrongnumber
armstrong-number java kodluyoruz mathematics maths patika-dev
Last synced: about 23 hours ago
JSON representation
A program that finds whether a number between 0-1000 that it receives as input from users is an Armstrong number.
- Host: GitHub
- URL: https://github.com/merttalug/armstrongnumber
- Owner: merttalug
- License: mit
- Created: 2022-03-11T13:38:36.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-03-11T14:19:43.000Z (over 2 years ago)
- Last Synced: 2023-07-14T14:12:18.274Z (over 1 year ago)
- Topics: armstrong-number, java, kodluyoruz, mathematics, maths, patika-dev
- Language: Java
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ArmstrongNumber
A program that finds whether a number between 0-1000 that it receives as input from users is an Armstrong number.
![img](https://i.ytimg.com/vi/OvANihsVDI8/maxresdefault.jpg)## What is Armstrong Number?
An n-digit number is called an Armstrong number if the sum of the nth powers of the digits is equal to the number itself.* Let's take the number 407 for example. (4^3)+ (0^3)+(7^3) = 64+0+343 = 407. This shows that 407 is an armstrong number.
* Let's also look at the number 1342. (1^4)+(3^4)+(4^4)+(2^4) =1+81+256+16=354 is not an armstrong number because it is not equal to 1342.
* 1634=1^4+6^4+3^4+4^4=1+1296+81+256=1634
* 54748=5^5+4^5+7^5+4^5+8^5=3125+1024+16807+1024+32768=54748## Sample Scope
```
tempnumber = number;
while (tempnumber != 0) {
tempnumber /= 10;
digitnumber++;
}tempnumber = number;
while (tempnumber != 0) {
digitvalue = tempnumber % 10;
digitpow = 1;
for (int i = 1; i <= digitnumber; i++) {
digitpow *= digitvalue;
}
res += digitpow;
tempnumber /= 10;```