0% found this document useful (0 votes)
18 views1 page

Armstrong Interval

The program finds Armstrong numbers between a lower and upper bound by taking each digit of a number to the power of the number of digits and summing them, checking if it equals the original number.

Uploaded by

dinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views1 page

Armstrong Interval

The program finds Armstrong numbers between a lower and upper bound by taking each digit of a number to the power of the number of digits and summing them, checking if it equals the original number.

Uploaded by

dinesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#Write a Python Program to Find Armstrong Number in an Interval

lower = 100#int(input("Enter lower range: "))


upper = 1000#int(input("Enter upper range: "))

for num in range(lower,upper + 1):


sum = 0
temp = num

while temp > 0:


digit = temp % 10
sum += digit ** 3
temp //= 10

if num == sum:
print(num)

You might also like