Sample output: GCD: 5
2. Write a program to input a number. Check and display whether it is Niven number or
not (a number is said to be Niven if it is divisible by its sum of digits. C program
Sample input: 126
Sum of its digits = 1 +2 +6=9 126 is divisible by 9
replace the number by the sum of
Answers
Answer:
Photosynthesis is a process used by plants and other organisms to convert light energy into chemical energy that, through cellular respiration, can later be released to fuel the organism's metabolic activities.
Answer:
public class KboatSpyNumber
{
public void spyNumCheck() {
Scanner in = new Scanner(System.in);
System.out.print("Enter Number: ");
int num = in.nextInt();
int digit, sum = 0;
int orgNum = num;
int prod = 1;
while (num > 0) {
digit = num % 10;
sum += digit;
prod *= digit;
num /= 10;
}
if (sum == prod)
System.out.println(orgNum + " is Spy Number");
else
System.out.println(orgNum + " is not Spy
Explanation:
if it helps you so pls mark me as brainliest