Let 153 be a number
So 153 is an armstrong number.
printf("nEnter your number : ");
printf("n%d is an armstrong number.",n);
printf("n%d is not an armstrong number.",n);
In the above program the first while loop is used to calculate the number of digits present in the given number where as the second one is used to check the number is armstrong number or not.
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