3️⃣C Program to Check Armstrong Number (With Program and Explanation)
C Program to Check Armstrong Number+
What is an Armstrong Number?
An Armstrong number is a number in which the sum of its digits raised to the power of the total number of digits is equal to the original number.
Example:
153 → 1³ + 5³ + 3³ = 153
Algorithm
-
Read a number from the user
-
Count the number of digits
-
Calculate the sum of each digit raised to the power of digits
-
Compare the sum with the original number
-
Display the result
C Program
Sample Output
Conclusion
This C program checks whether a given number is an Armstrong number. It works for numbers of any length and helps beginners understand loops, conditions, and mathematical functions in C
📘 C Programming Series – What’s Next?
👉 In the next post of this series, we will learn how to write a C Program to Check Palindrome Number, with complete explanation and output examples. Stay tuned! 🚀
Comments
Post a Comment