Computer Science, asked by vanaya29, 1 month ago

print all the armstrong numbers from 100 to 200 through nested loop​

Answers

Answered by singhnilu744
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