C Program:
#include<stdio.h>
long int factorial(int n)
{
if (n == 0)
return 1;
else
return (n * factorial(n - 1));
}
void main()
{
int n, t;
int sum = 0;
printf("\nEnterthe number");
scanf("%i", &n);
t = n;
while (t != 0)
{
sum += factorial(t % 10);
t /= 10;
}
if (sum == n)
printf("\nIt is a Strong number");
else
printf("\nIt is not a Strong number");
}
No comments:
Post a Comment