Computer Science, asked by Sciences147, 3 months ago

To find whether a given number is armstrong or not in python program

Answers

Answered by devika2271
0

Answer:

Python Program to Check Armstrong Number

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

sum = 0.

temp = num.

while temp > 0:

digit = temp % 10.

sum += digit ** 3.

temp //= 10.

if num == sum:

Answered by Anonymous
1

Answer:

hello,

Explanation:

#program to find whether a given number is armstrong or not

n=int(input("enter the number"))

a=n

sum=0

while n>0:

   r=n%10

   sum=sum+r**3

   n=n//10

if sum==a:

   print("its an armstrong number")

else:

   print("its not an armstrong number")

hope it helps you

please mark brainliest

@ItzSnowySecret07

Similar questions