JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import java.util.*;
public class SpyNumber
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("Enter your no.");
int number=sc.nextInt();
int a,b,c,d,e,sum,product;
a=number;
sum=0;
product=1;
for(c=0;a!=0;c++){
b=a%10;
a=a/10;
c+=1;
}
d=0;
int[]num =new int[c];
a=number;
while(a>0){
b=a%10;
a=a/10;
num[d]=b;
d++;
}
for(e=0;e<=d;e++){
sum+=num[e];
product*=num[e];
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run