2B4B5506BF669D6925DF08F1CBB41563 armstrong number while loop in python

armstrong number:- à¤†à¤°्मस्ट्रांग नंबर वे नंबर होते हैं जो अपनी ही वैल्यू का क्यूब करके जोड़ने पे वही à¤µैल्यू प्राप्त होती है armstrong number कहलाते हैं l  

जैसे : 13+53+33 = 153

        1+125+27 = 153

# print armstrong number using while loop


x=int(input("enter any value:="))

while (x!=0):

    z=x%10

    s=s+z*z*z

    x=x//10

if (s==y):

    print("Armstrong Number")

else:

    print("Not Armstrong Number")

Post a Comment

Previous Post Next Post

Advertigement

Comments