/* Programming to find the armstrong number */

#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
	long int sum,n,a,b,c,x;
	clrscr();
	printf("Enter Number");
	scanf("%ld",&n);
	x=n;
	for(sum=0;n>0;)
	{
		a=n/10;
		b=a*10;
		c=n-b;
		sum=sum+pow(c,3);
		n=a;
	}
	if (x==sum)
		printf("The given number is armstrong");
	else
		printf("The given number is not armstrong");
	getch();
}
/* input: 153
   output:The given number is armstrong

   input: 204
   output:The given number is not armstrong

*/