Computer Science, asked by arpitasi3332, 1 month ago

I am CSE Student I want to become software developer I wants to help regarding guidance in which tutorial best for me any one can give me a better solution .Guys plz help me

Answers

Answered by mauryakavya630
0

Explanation:

import java.util.Scanner;

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 Number");

}

}

Similar questions