#include<studio.h>
void main( )
{ int no,sum =0,r,x;
printf ("\n enter no ");
scanf("%d",&no);
x=no;
while (no>0)
{
r=no%10;
sm=sm+(r*r*r);
no=no/10;
}
if(sum==x)
{
printf("\n It is Armstrong no");
}
else
{printf(" not Armstrong no");
}
void main( )
{ int no,sum =0,r,x;
printf ("\n enter no ");
scanf("%d",&no);
x=no;
while (no>0)
{
r=no%10;
sm=sm+(r*r*r);
no=no/10;
}
if(sum==x)
{
printf("\n It is Armstrong no");
}
else
{printf(" not Armstrong no");
}
No comments:
Post a Comment