C Program For Armstrong Number
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Program for armstrong of number
#include<stdio.h>
#include<conio.h>
int main()
{
int n,r,s=0,m;
printf("\nEnter a number");
scanf("%d",&n);
m=n;
while(n!=0)
{
r=n%10;
s=s+(r*r*r);
n=n/10;
}
if(m==s)
printf("No is armstrong");
else
printf("No is not armstrong");
}
Did we exceed your expectations?
If Yes, share your valuable feedback on Google

