Angle B is 50 degrees. We already know that the interior angles of any triangle must add up to 180 degrees. It is given to us that we have a 90 degree angle and a 40 degree angle in our triangle. We must solve for x (in this case Angle B.) Set up the equation and solve.
180=90+40+x
90=40+x
50=x
Therefore Angle B is 50 degrees