For any lengths to be sides of a right angled triangle, the sum of the squares of the 2 of them should be equal to the square of the third.
Here,
182+242=324+576=900=302
Since the squares of 18 and 24 add up to the square of 30, these form a Pythagorean triplet
Hence, can be used to represent the three sides of a right-angled triangle.