Computer Science, asked by tridibrup17, 10 months ago

Write a python program to check whether a number is an Armstrong number or not.
For eg=1^3+3^3+5^3=153

Answers

Answered by harshgaur997
2

Answer:

num = int(input("Enter a number: "))

# initialize sum

sum = 0

# find the sum of the cube of each digit

temp = num

while temp > 0:

digit = temp % 10

sum += digit ** 3

temp //= 10

# display the result

if num == sum:

print(num,"is an Armstrong number")

else:

print(num,"is not an Armstrong number")

Answered by Avni2348
0

Answer:

if num=sum...............

Similar questions