Silna liczba w C
#include <stdio.h>
int main()
{
int number,temp,fact,rem,sum =0;
printf("Enter Number to check wheather given number is Strong or Not ");
scanf("%d",&number);
temp = number;
while(number>0)
{
fact = 1;
rem = number%10;
for(int i = rem;i>=1;i--)
fact = fact*i;
sum += fact;
}
if(temp == sum)
printf("%d is a Strong Number",temp);
else
printf("%d is not a Strong NUmber",temp);
return 0;
}
Rajesh Javvadi