write a program to check whether no is neven no or not??? plz correct answer only if don't know so not give..
Answers
Answered by
1
Answer:
Method:
static boolean isNiven(int number)
{
// calculate sum of digits
int sum = 0;
for (int temp = number; temp > 0; temp /= 10)
sum += temp % 10;
// Return true if sum of digits is multiple of number
return (number % sum == 0);
}
Similar questions