Skip to content

Commit 8d59b07

Browse files
author
codehouseindia
authored
Merge pull request codehouseindia#221 from khush3211/patch-1
Added the Armstrong program
2 parents dd4bd69 + a7f56bf commit 8d59b07

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

qwert.pu

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#https://www.facebook.com/sachdevakhush/posts/1436227196578156
2+
#Subscribed by Khush Sachdeva
3+
num = int(input("Enter a number: "))
4+
5+
sum = 0
6+
7+
temp = num
8+
while temp > 0:
9+
digit = temp % 10
10+
sum += digit ** 3
11+
temp //= 10
12+
13+
if num != sum:
14+
print(num,"is not an Armstrong number")
15+
else:
16+
print(num,"is an Armstrong number")

0 commit comments

Comments
 (0)