You are on page 1of 1

#include<stdio.

h>
#include<conio.h>
void main()
{
int n,rev=0,temp,sum=0;
clrscr();
printf(" enter your number ");
scanf("%d",&n);
temp=n;
while(temp!=0)
{
rev=temp%10;
sum=sum+rev*rev*rev;
temp=temp/10;
}
if(n==sum)
{
printf(" %d is armstrong number ",n);
}
else
{
printf(" %d is not armstrong number ",n);
}
getch();
}

You might also like