Write a Program to find Two-Digit Divisors Where the Tens Digit Is Greater Than the Units Digit.
//JS
let n = 1092;
let i = 10;
while(i < 100){
if(n % i == 0){
let a = Math.floor(i / 10);
let b = i % 10;
if(a > b){
console.log(i);
}
}
i++;
}
#Python
n = 1092
i = 10
while i < 100:
if n % i == 0:
a = i // 10
b = i % 10
if a > b:
print(i)
i += 1
Output:
21
42
52
84
91
Top comments (0)