n=int(input("enter value of n=")) no=int(input("no.of digits=")) x=n arm=0 while(n>0): r=n%10 arm=arm+(r**no) n=n/10 if(x==arm): print("given no. is armstrong number") else: print("given no. is not a armstrong number")
n=int(input("enter value of n=")) no=int(input("no.of digits=")) x=n arm=0 while(n>0): r=n%10 arm=arm+(r**no) n=n/10 if(x==arm): print("given no. is armstrong number") else: print("given no. is not a armstrong number")