Code Below:
import java.util.*;
class niven
{
public static void main()
{
Scanner s=new Scanner(System.in);
int n,a,sum=0,k;
System.out.println("enter a no.");
n=s.nextInt();
k=n;
while(n>0)
{
a=n%10;
sum=sum+a;;
n=n/10;
}
if (k%sum==0)
System.out.println("niven no.");
else
System.out.println("not niven no.");
}
}