Computer Science, asked by floraamrit248, 8 months ago

wap to enter a number and check whether it is a Spy number or not using while loop only​

Answers

Answered by anindyaadhikari13
26

Here is your answer.

<hr/>

class x

{

static void main(int n)

{

int s=0,p=1;

for(;n! =0;)

{

int d=n%10;

s+=d;

p*=d;

n/=10;

}

if(s==p)

System.out.println("Spy Number.");

else

System.out.println("Not a Spy Number.");

}

}

<hr/>

Answered by divyansh05887
1

Answer:

HERE IS YOUR REQUIRED PROGRAM

HOPE IT WILL HELP YOU..

Attachments:
Similar questions