C Exercises: Find the Armstrong number for a given range of number
30. Armstrong Numbers in a Range
Write a C program to find the Armstrong number for a given range of number.
An Armstrong number (or narcissistic number) is a number that is equal to the sum of its own digits each raised to the power of the number of digits. The program should prompt the user for the lower and upper limits of the range. It should iterate through each number in that range, checking if it meets the Armstrong number condition, and print out any Armstrong numbers found.
Sample Solution:
C Code:
Output:
Input starting number of range: 1 Input ending number of range : 1000 Armstrong numbers in given range are: 1 153 370 371 407
Flowchart:

For more Practice: Solve these Related Problems:
- Write a C program to find all Armstrong numbers within a specified range using iterative loops.
- Write a C program to list Armstrong numbers in a range and count the total number found.
- Write a C program to identify Armstrong numbers within a range using a recursive power function.
- Write a C program to output Armstrong numbers in a range along with the digit count for each.
C Programming Code Editor:
Previous: Write a C program to check whether a given number is an armstrong number or not.
Next: Write a program in C to display the pattern like a diamond.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.