This program takes an input from the user in the console window and checks if the entered number is an armstrong number. A number is said to be an Armstrong number if and only if the sum of the cubes of each individual digit in that number equals to that number.This program is done in python.
print " Is An Armstrong Number";
print " Is Not An Armstrong Number";
The arm(x) performs operations on the user input x, then it displays the output according to the result achived. r is a variable which stores the last digit of x and s is a variable which stores the sum of the cubes of the digits. Then after the termanating condition, the while loop stops and a condition is used to check whether the variable s is equal to the input.
Latest posts by Bikash Panda (see all)
- OSMC on Raspberry PI with Setup and Control using Android App - July 7, 2017
- DHT12 Interfacing with Raspberry Pi using Pi4J - June 19, 2017
- Send data using MQTT from Raspberry Pi with JAVA - June 12, 2017