For this question we need to consider the equation:
ΔStotal = ΔSsystem - ΔH/T
For and exothermic reaction, -ΔH/T is positive. Therefore, as T increases -ΔH/T becomes more negative, ΔStotal becomes less positive/more negative and the position of equilibria moves to the left. This results in K decreasing.
For an endothermic reaction, -ΔH/T is negative. Therefore, as T increases, -ΔH/T becomes less negative, ΔStotal becomes less negative/more positive and the position of equilibrium moves to the right. This results in K increasing.