#include <stdio.h>
#include <math.h>
int main() {
int n,i,digit=0,sum=0;
printf("Enter n:\n");
scanf("%d",&n);
i=n;
while(i>0)
{
i=i/10;
digit++;
}
i=n;
while(i>0)
{
sum=sum+pow(i%10,digit);
i=i/10;
}
if(sum+-n)
{
printf("Armstrong number");
}
else
{
printf("Not an Armstrong number");
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: