How To Check No Is Armstrong Or Not In C Program

Hello Guys,

Today I am going to tell you How To Check No Is Armstrong Or Not In C Program.  By using this program you Check No Is Armstrong Or Not In C Program


How To Check No Is Armstrong Or Not In C Program
How To Check No Is Armstrong Or Not In C Program

#include<stdio.h>
#include<conio.h>
void main()
{
int arm=0,no,r,original;
printf("Enter the number to check Armstrong Or Not=");
scanf("%d",&no);
original=no;
while(no>0)
{
r=no%10;
arm=arm+r*r*r;
no=no/10;
}
if(no==arm)
{
printf("No Is Armstrong");
}
else
{
printf("No Is Not Armstrong");
}
getch();
clrscr();
}


Comments