/* Armstrong number
examples-370,371,153,407 */
#include<stdio.h>
int main(){
int n,original,result,remainder;
printf("Enter an three digit integer:");
scanf("%d",&n);
original=n;
while(n!=0){
remainder=n%10;
result+=remainder*remainder*remainder;
n/=10;
}
if(result==original){
printf("\n%d is a armstrong number",original);
}else{
printf("\n%d is not a armstrong number",original);
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: