Code Below:
import java.util.*;
class SpecialNo
{
public static void main()
{
Scanner s=new Scanner(System.in);
int n,dup,pro,sum=0,i,a;
System.out.println("Enter a no.");
n=s.nextInt();
dup=n;
while(dup>0)
{
pro=1;
a=dup%10;
for (i=1;i<=a;i++)
pro=pro*i;
sum=sum+pro;
dup=dup/10;
}
if(sum==n)
System.out.println(n+" is a special no.");
else
System.out.println(n+" is not a special no.");
}
}