Q. WAP to accept any number and check the number is spy or not

Example:
Input Number- 1124
Sum=1+1+2+4
Multiply=1*1*2*4=8
Sum & multiplication value both are same, the 1124 is a spy number.
  • Enter a number:
  • The number is: