Here you will get a program for a strong number in C.
What is Strong Number?
A number where the entirety of factorial of individual digits is equivalent to the number is called a strong number.
For instance, 145 is a strong number in light of the fact that 145=(!1)+(!4)+(!5)=1+24+120=145
The beneath C program will check whether a given number is a strong number or not.
Program
#include<stdio.h>
int fact(int n){
int i,fac=1;
for(i=1;i<=n;++i){
fac*=i;
}
return fac;
}
int main(){
int n,t,sum,m;
printf("Enter a number:");
scanf("%d",&n);
m=n;
while(m!=0){
t=m%10;
sum+=fact(t);
m=m/10;
}
if(sum==n){
printf("Strong Number");
}
else{
printf("Not Strong Number");
}
return 0;
}
Output
Remark underneath on the off chance that you are confronting any trouble to comprehend above solid number in C program.