#include<stdio.h>
#include<conio.h>
main()
{
int n,r,sum=0,t;
clrscr();
printf("enter the value:");
scanf("%d",&n);
t=n;
while(n!=0)
{
r=n%10;
sum=sum+r*r*r;
n=n/10;
}
if(t==sum)
{
printf("it is a armstrong");
}
else
{
printf("it is not armstrong");
}
getch();
}�
No comments:
Post a Comment