Product divisible

There exists 5 2-digit positive integers that each have the property where they are divisible by the product of their digits.

Find the sum of all such these 5 integers.


The answer is 98.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Prince Loomba
Jan 19, 2017
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
public static void main(String[] args) {


        for(int x=10;x<=99;x++){


           int a=x%10;


           int b=(int)(x/10)%10;


           int c=a*b;


           if (a!=0 && b!=0){if(x%c==0)System.out.println(x);} 


        }


    } 

Output:

11 12 15 24 36

Sum

98

I've added the "```" in your programming solution.

Pi Han Goh - 4 years, 4 months ago

Log in to reply

Thanks very much!

Prince Loomba - 4 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...