how many 4 - digit numbers ( abcd ) can be formed such that | a – d | = 2 ?
digit a can be filled in 9 ways ( excluding 0 ) digit b can be filled in 10 ways digit c can be filled in 10 ways digit d can be filled in 2 ways ( because of modulus a - d ) the answer will be 9 * 10 * 10 * 2 = 1800 ans c
multiply(multiply(multiply(const_10, const_10), subtract(const_10, const_1)), 2)