num = int(input())
      # initialize sum
      sum = 0
      # find the sum of the cube of each digit
      temp = num
      while temp > 0:
         digit = temp % 10
         sum += digit ** 3
         temp //= 10
      # display the result
      if num == sum:
         print(num,"is an Armstrong number")
      else:
         print(num,"is not an Armstrong number")
      
      Python language logo

      ArmstrongNo

      mathematics
      armstrong

      program to find whether the given number is an Armstrong number or not | 153 = 111 + 555 + 333 // 153 is an Armstrong number.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.