+0  
 
0
36
1
avatar

Find the number of 4-digit even numbers, where all the digits are different.

 May 3, 2020
 #1
avatar
0

a=1;b=0;c=0;d=0;p=0; cycle:n=a*1000+b*100+c*10+d;if(n%2==0 and a!=b and a!=c and a!=d and b!=c and b!=d and c!=d, goto loop, goto next); loop:printn," ",;p=p+1; next:d++;if(d<10, goto cycle, 0);d=0;c++;if(c<10, goto cycle, 0);d=0;c=0;b++;if(b<10, goto cycle,0);b=0;c=0;d=0;a++;if(a<10, goto cycle,0);print"Total = ",p

 

OUTPUT =2,296 such numbers

 May 3, 2020

17 Online Users

avatar