// Compiler : Dev C++4.9.9.2
#include<stdio.h>
int main()
{
int num,i,f,r,sum=0,temp;
printf("Number : ");
scanf("%d",&num);
temp=num;
while(num)
{
i=1,f=1;
r=num%10;
while(i<=r)
{
f=f*i;
i++;
}
sum+=f;
num/=10;
}
if(sum==temp)
printf("\n\n%d Is Strong Number.",temp);
else
printf("\n\n%d Is Not Strong Number.",temp);
getch();
return 0;
}
#include<stdio.h>
int main()
{
int num,i,f,r,sum=0,temp;
printf("Number : ");
scanf("%d",&num);
temp=num;
while(num)
{
i=1,f=1;
r=num%10;
while(i<=r)
{
f=f*i;
i++;
}
sum+=f;
num/=10;
}
if(sum==temp)
printf("\n\n%d Is Strong Number.",temp);
else
printf("\n\n%d Is Not Strong Number.",temp);
getch();
return 0;
}
Post a Comment