SPY NUMBER | ISC COMPUTER 2024 | survnor.blogspot.com
Write a program to find out all spy number present within a given range. (What is spy number:- If the sum of its digits equal to the product of its digits it is called spy number). Example:- Given number:312, Sum=3+1+2=6 & Product=3x1x2=6. Therefore, 312 is a spy number. ALGORITHM STEP 1:- Start. STEP 2:- Declare spyno as a class. Declare r1 a, r2 and i as a variable. STEP 3:- Declare input() as a method of return type void. Now accept the starting range and ending range from user and store it into r1 and r2 simultaneously. Now print the starting range and ending which has been given by user. STEP 4:- Now close the method input(). Declare calculate() as a method of return type void. STEP 5:- Start iteration on ‘i’. Starting range(r1) assigned on ‘i’ and up to r2 as ending range and incremented 1 in each step. Now assigned ‘i’ on num. STEP 6:- Declare rem, sum, multi and f as a variable where sum ß 0, f ß 0, mul...