+0  
 
0
374
1
avatar

How many two-digit numbers are divisible by each of their digits?

 Nov 25, 2019

Best Answer 

 #1
avatar
+1

a=1;b=1;p=0; cycle:d=a*10+b;if(d%a==0 and d%b==0, goto loop, goto next); loop:printd," ",;p=p+1; next:b++;if(b<10, goto cycle, 0);b=1;a++;if(a<10, goto cycle, 0);print"Total = ",p

 

11  12  15  22  24  33  36  44  48  55  66  77  88  99  Total =  14 such numbers

 Nov 26, 2019
 #1
avatar
+1
Best Answer

a=1;b=1;p=0; cycle:d=a*10+b;if(d%a==0 and d%b==0, goto loop, goto next); loop:printd," ",;p=p+1; next:b++;if(b<10, goto cycle, 0);b=1;a++;if(a<10, goto cycle, 0);print"Total = ",p

 

11  12  15  22  24  33  36  44  48  55  66  77  88  99  Total =  14 such numbers

Guest Nov 26, 2019

3 Online Users

avatar
avatar
avatar