Program to check whether the given number is Armsoring number or not
https://www.computersprofessor.com/2016/05/program-to-check-whether-given-number.html?m=0
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