print all the armstrong numbers from 100 to 200 through nested loop
Answers
Answered by
0
Answer:
include < stdio.h >
int main()
{
int num, count = 1, rem, sum;
while(count <= 500)
{
num = count;
sum = 0;
while(num)
{
rem = num % 10;
sum = sum + (rem * rem * rem);
num = num / 10;
}
if(count == sum)
{
printf("%d is a Armstrong number\n", count);
}
count++;
}
return 0;
}
Output:
1 is a Armstrong number
153 is a Armstrong number
370 is a Armstrong number
371 is a Armstrong number
407 is a Armstrong number
Explanation:
hope it helpful for you
please mark me as Brainliest
Similar questions
Math,
17 days ago
Computer Science,
17 days ago
Chemistry,
1 month ago
Hindi,
9 months ago
Physics,
9 months ago