write a program to check for Armstrong number in c language.
#include<stdio.h>
#include<conio.h>
Void main( )
{
Int
i,j,num,sum=0;
Printf(“enter
any number:”);
Scanf(“%d”,&i);
Num=I;
While(num!=0)
{
J=num%10;
Sum=sum+(j*j*j);
Num/=10;
}
If(sum==i)
{
Printf(“entered
no. is Armstrong”);
}
Else
{
Printf(“entered
no. is not Armstrong”);
}
}
This comment has been removed by the author.
ReplyDelete