SPY NUMBER IN JAVA.
*********************************
import java.util.Scanner;
public class Spy_Number
{
public static void main (String args[])
{
Scanner sc=new Scanner(System.in);
int num, d, sum=0, prod=1;
System.out.println("ENTER A NUMBER");
num=sc.nextInt();
while(num!=0)
{
d=num%10;
sum=sum+d;
prod=prod*d;
num=num/10;
}
if(sum=prod)
System.out.println("IT'S A SPY NUMBER");
else
System.out.println("IT'S NOT A SPY NUMBER");
}
}
*******************************
By- BLUEJ HUB
0 Comments