Write a program to find the sum of factorial of each digit in the given number.
Input Format
Input consists of integer
Output Format:
Refer the sample output format
Sample Input:
56
Sample Output:
840
Answers
Answered by
0
Answer:
hiiiiiiiiiiiiiiiiiiii dear
what's up
Explanation:
follow me
MARK me BRAINLIEST
Answered by
0
Program to find the sum of factorial of each digit in the given number.
The below program is in C language:
#include <stdio.h>
int main() {
int number, fact, sum=0;
printf("Enter the number: ");
scanf("%d", &number);
for(int i=number; number>0;)
{
fact = 1;
for(int j=1; j<=number%10; j++)
{
fact= fact * j;
}
sum= sum + fact;
number = number/10;
}
printf("The sum of factorial of each digit is : %d", sum);
}
In the above program, number is the given number as input. Fact is the factorial and sum is the sum of factorial of each digit.
#SPJ3
Similar questions