Can anyone tell me how to write a program in java to identify that is it a spy number or not for 'four' digit number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone tell me how to write a program in java to identify that is it a spy number or not for 'four' digit number

20th Jan 2021, 5:00 PM
Ayush Pandey
Ayush Pandey - avatar
2 Answers
0
Spy number means product of digits=sum of digits Use a while loop to break the digits and multiple them and sum up them. And check the sum and product's equality. If still you are confused then I will provide you the answer. And try to post your code's link too
20th Jan 2021, 5:24 PM
Atul [Inactive]
0
Ok thanks
21st Jan 2021, 2:47 AM
Ayush Pandey
Ayush Pandey - avatar