Let a,b,c be the sides of the triangle. Make c the longest side. The value of a and b doesn't matter.
a = 9
b = 40
c = 41
The value of a^2+b^2 is
a^2+b^2 = 9^2+40^2 = 1681
The value of c^2 is
c^2 = 41^2 = 1681
Because a^2+b^2 = c^2 for these values, this means that we have a right triangle.
Answer is choice D