For this question, we need to integrate the joint density function by the full bounds of x and y and set the result equal to 1. It honestly doesn't matter which variable you start with; just make sure the bounds for the first are either x < y < 40 or 20 < x < y.
∫2040 ∫20y c dx dy
∫2040 c(y-20) dy
c(y2/2 - 20y) |2040
c(800 - 800 - 200 + 400)
200c = 1
c = 1/200
Thus, for this to be a joint density function, c = 1/200 = 0.005.