Number of all four digit numbers having different formed of the digits 1, 2, 3, 4 and 5 and divisible by 4 is
24
In order to make number divisible by 4, its last two digits must be divisible by 4, which in this case can be 12, 24. 32 or 52.
Since repetition of digits is not allowed, the remaining first two digits can be arranged in 3×2 ways in each case.
Total number of numbers that can be formed 4×3×2 = 24