63. C Program To find all the Factorial Prime Numbers Between 1 to 99.
How does this program work?
- This Program is used to find all the factorial prime numbers between 1 to 99.
- Here by using the for loop and if case we get the prime numbers and after that we get the factorials of that prime numbers.
- Here we get the sum of prime numbers factorials.
Here is the code
#include <stdio.h>
int main(void)
{
int i,j,k,count,first,last,sum=0,fact=1;
for(i= 2; i<= 5; ++i)
{
count=0;
for(k=2; k<=i/2; k++)
{
if((i % k) == 0)
{
count++;
}
}
if(count==0)
{
fact=1;
for(j=1;j<=i;j++)
{
fact*=j;
printf("\n factorial of prime numbers is: %d ",fact);
}
printf("\n factorial of prime numbers is: %d ",fact);
sum+=fact;
}
}
printf("\n Sum of prime numbers factorial is: %d ",sum);
return 0;
}