Program to check whether the given number is Armsoring number or not

sum of cubes of given number is equal to the actual number.

#include<stdio.h>
#include<conio.h>
main (  )                                 
{
int n, s = 0, a, r,n;
printf (“enter a number “);
scanf(“%d”,&n);       
a= n;
while (n!=0)
{
r = n% 10;
s = s + r *r*r;
n=n/10;
}
if (a==s)
printf (“armstrong number”);
else
printf (“not an armstrong number”);
getch();
}

Out Put:
 enter a no 153
Armstrong number
Enter a no 67
Not an arm strong number

Related

C Programs 3667062935685465506

Post a Comment

emo-but-icon

item