Answer:
Written in Python
number = int(input("Enter a number: "))
computesum = 0
lent = len(str(number))
for digit in str(number):
computesum += int(digit)**lent
if number == computesum:
print("true")
else:
print("false")
Step-by-step explanation:
This line prompts user for Input input
number = int(input("Enter a number: "))
This line initialises the sum of the nth power of the digits to 0
computesum = 0
This line gets the length of input (i.e. number of digits)
lent = len(str(number))
The following iteration iterates through the digit to check for Armstrong numbers
for digit in str(number):
computesum += int(digit)**lent
This checks if the input number equals the computed sum
if number == computesum:
print("true") --- if yes, "true" is printed
else:
print("false") --- if otherwise, "false" is printed
See attachment for complete program in its right format