In order to be a triangle, the sum of two sides must be greater than the third side. (Just think about it for a bit and you will see why this has to be true). For example, could you have a triangle with side 3 inches, 4inches, and then a whopping 100 inches? No, because the other two sides are too short to fully connect a triangle!
So once you understand this, we can find the possible length of the missing side.
Let x be the length of the missing side in centimeters. The other two sides are 18cm and 40cm.
So one possible combination:
The sum of our two known lengths must be larger than the unknown length:
18 + 40 > x
58 > x
Therefore one constraint is that our third side has to be less than 58 centimeters.
Another combination:
18 + x > 40
x > 22
So another constraint is that our third side must be larger than 22 cm.
The last combination is pointless:
40 + x > 18
Since 40 is already larger than 18, then "40 + x" is obviously larger than 18.
So therefore our x has to be in this range:
22 < x < 58
In other words, our third side has to be larger than 22 cm, but less than 58 cm.