CODE.The first digit of the code is same as the LAST digit of the four digit number. The next digit(s) of the code is formed by ADDING the adding all the digits of the four digit number.For example, in 1112, the last digit is 2 and the sum of all the digits is 5. HENCE, the code for 1112 is 25.Similarly, in 1117, the last digit is 7 and the sum of all the digits is 10. Hence, the code for 1117 is 710.