class arraycheck
{
int a;
arraycheck()// Constructor
{
// check to print whether an entered number is
// a special number
a=0;
}
void cal(int a)
{
int ll=a;
int s=0;
int fact=1,n=0,n1=0,digit=0;
System.out.println(“The number is “+ll);
while(ll!=0)
{
n=ll/10;
n1=n*10;
digit=ll-n1;

System.out.println(“The digit is “+digit);
for(int j=1;j<=digit;j++)
fact=fact*j;
s=s+fact;
fact=1;
ll=ll/10;
}

if (s==a)
{
System.out.println(“The value of sum of factorial of digits is “+s);
System.out.println(“Hence the number is a special number.”);
}
else
{
System.out.println(“The value of sum of factorial of digits is “+s);
System.out.println(“Hence the number is not a special number.”);
}
}
}