PYTHON

Write a python program to check whether a number is Armstrong number or not.

num = int(input("Enter the number :- ")) temp = num sum = 0 while temp !=0: rem = temp % 10 sum = sum + rem ** 3 temp = temp //10 if sum == num: print("The number is armstrong.... ",num) else: print("The number is not armstrong.... ",num)

OUTPUT…..

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.