C Program to Find Armstrong Number


Armstrong number:

An Armstrong number is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong 


Program:

#include<stdio.h>
int main()
{
int i j k l m;
printf( "give a three digit number to find Amstrong ");
scanf( d &i);
j=i/100;
k=i 100;
l=k/10;
m=k 10;
j=j*j*j;
l=l*l*l;
m=m*m*m;
if(i==j+l+m)
{
printf( "yes %d is an Amstrong number ", i);
}
else
printf("No %d is not an Amstrong number ", i );
}
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...
 
Posts RSSComments RSSBack to top
© 2013 Updated Tech News Results and Reviews