Given number be 12345.
A number to be divisible by 4, the number formed by the last two digits is divisible by 4.
So, 12345 – 1 = 12344 is divisible by 4
12345 – 2 = 12343 is not divisible by 4
12345 – 3 = 12342 is not divisible by 4
12345 – 4 = 12341 is not divisible by 4
12345 – 5 = 12340 is divisible by 4
and
12345 + 1 = 12346 is not divisible by 4
12345 + 2 = 12347 is not divisible by 4
12345 + 3 = 12348 is divisible by 4
12340, 12344 and 12348 are divisible by 4.
∴ 12344 is the nearest number to 12345 which is divisible by 4.