Write a program to input a number and check whether the number is special number or not.(A number is said to be a special number, if the sum of the factorial of the digit of the number is same as the original number) example: 145 is the special number because,1!+ 4 !+ 5!=1 + 24 + 120= 145 (where!stands for factorial. example:5!= 1* 3*4*5=120)
Answers
Answered by
0
Answer:
number=input("Enter the number to check for special number: ")#take the number from the user. for x in number:#for loop to read the number. Total=Total+int(x)#calculate the total. product=product*int(x)#clculate the product
Answered by
3
JAVA:-
Explanation:
class Brainly
{
static void main()
{
int i,j,r,d;
for(i=100;i<=999;i++)
{
r=0;
for(j=i;j>0;j=j/10)
{
d=j%10;
r=r*10+d;
}
if(r==i)
System.out.println(i);
}
}
}
Similar questions