netoops blog

Saturday, 24 August 2013

Armstrong Number

#include<stdio.h>
#include<conio.h>

int main()
{
long int s = 0,d,n,t;

printf ("ENTER ANY NUMBER :");
scanf ("%ld",&n);
t = n;
while (t)
{
d = t % 10;
s = s + d*d*d;
t /= 10;
}
if (s == n)
printf ("%d IS ARMSTRONG NUMBER ",n);
else
printf ("%d IS NOT ARMSTRONG NUMBER ",n);


return 0;
getch();
}

Tech Knowledege
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments :

Post a Comment

 
Subscribe For Free Updates!

We'll not spam mate! We promise.

Become Our Fan on Social Sites!