c-programming

C program to find Armstrong Number

This example shows you how to find the entered number is Armstrong number or not in C. Very useful program for job seekers and school / college students.

I have already written the same program in PHP, Python, C# and Java, please use “Armstrong” keyword to find the programs if you wish to.

Here is the script:

The logic has three steps,

1. Find the reminder and cube the reminder.
2. Add it to the variable sum.
3. Find the quotient for the next loop.

If both the entered number and the value of sum variable is equal then the number is Armstrong Number.

153, 371, 407 are the Armstrong numbers.

 

Related Posts

Leave a Reply