example of armstrong number
Example 1: armstrong number
sum of cubes of the digits
Example 2: armstrong number in c
#include <stdio.h>
int main() {
int num, originalNum, remainder, result = 0;
printf("Enter a three-digit integer: ");
scanf("%d", &num);
originalNum = num;
while (originalNum != 0) {
remainder = originalNum % 10;
result += remainder * remainder * remainder;
originalNum /= 10;
}
if (result == num)
printf("%d is an Armstrong number.", num);
else
printf("%d is not an Armstrong number.", num);
return 0;
}