We know that the sum of angles in a trapezium (or any four-sided shape) is 360 degrees. If angle A and angle B are both respectively 40 and 40, they make up a sum of 80 degrees.
All we need to do is subtract that from 360, and we get 280 degrees. Since there are two unknown angles, we divide 280 by two and get two 140-degree angles (C and D). (We know they will be equal angles since A and B are also equal, and line AB is parallel to line DC.)