#include <stdio.h>
#include <conio.h>
void main()
{
int n=0, noofdigits=0, n1=0, rem=0, i=0, k=1, sum=0;
printf("enter the no");
scanf("%d",&n);
n1=n; // because after the loop the value of n lost to zero
while(n>0)
{
noofdigits++;
n=n/10;
}
n=n1; // to regain the original value because after the loop value becomes zero.
while(n>0)
{
rem=n%10;
k=1;
for(i=0; i<noofdigits; i++)
{
k=k*rem;
}
sum=sum+k;
n=n/10;
}
if(sum==n1)
printf("the number is armstrong");
else
printf("the number is not armstrong");
}