#include<stdio.h>
#include<conio.h>
void main()
{
int rem,temp,n,arm=0;
clrscr();
printf("\nEnter any number :- ");
scanf("%d",&n);
temp=n;
while(temp!=0)
{
rem=temp%10;
arm=arm+rem*rem*rem;
temp=temp/10;
}
if(n==arm)
{
printf("\nThe given number is armstrong number");
}
else
{
printf("\nThe given number is non-armstrong number");
}
getch();
}
Output :-
Back to 'C Language Programs'
No comments:
Post a Comment