program to test armstrong number
//program to test armstrong number
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main()
{
int n,dig,sum=0,temp;
clrscr();
printf("Enter a number:");
scanf("%d",&n);
temp=n;
while(temp!=0)
{
dig=temp%10;
sum=sum+pow(dig,3);
temp=temp/10;
}
if(sum==n)
{
printf("nn%d is armstrong",n);
}
else
{
printf("nn%d is not armstrong",n);
}
getch();
}
