This a Python program to check whether a given number is armstrong or not . |
PROGRAM :
num = int(input('Enter any number : ')) sum = 0 copy = num while copy > 0: remainder=copy%10 sum += remainder ** 3 copy //= 10 if num == sum: print(num,"is an Armstrong number") else: print(num,"is an not Armstrong number")
OUTPUT :
Python - Armstrong or not |
Python - Armstrong or not |
Similar Programs :
C Program to check a number is Armstrong number or not
Cpp Program to check a number is Armstrong number or not
Java Program to check a number is Armstrong number or not