Friday 31 August 2012

ARMSTRONG NUMBER

#include<stdio.h>
#include<conio.h>
void main ()
{
int a,b,c,d,n,sum=0;
printf ("Enter the number");
scanf ("%d",&n);
a=n%10;
b=n/10;
c=b%10;
d=b/10;
sum = (a*a*a)+(c*c*c)+(d*d*d);
if (sum==n)
{
printf ("the number isarmstrong");
}
else
{
printf ("the number is not armstrong");
}
getch();
}http://www.google.co.in/

No comments:

Post a Comment