C Programming Code Examples C > Mathematics Code Examples Amstrong Number Program In C programming Amstrong Number Program In C programming An armstrong number is a number which equal to the sum of the cubes of its individual digits. For example, 407 is an armstrong number as #include <stdio.h> int main() { int arms = 407; int check, rem, sum = 0; check = arms; while(check != 0) { rem = check % 10; sum = sum + (rem * rem * rem); check = check / 10; } if(sum == arms) printf("%d is an armstrong number.", arms); else printf("%d is not an armstrong number.", arms); return 0; } procedure armstrong : number check = number rem = 0 WHILE check IS NOT 0 rem = check modulo 10 sum = sum + (rem)3 divide check by 10 END WHILE IF sum equals to number PRINT armstrong ELSE PRINT not an armstrong END IF end procedure