The lenght of the largest piece will be the HCF of 18 and 24.
Factors of 18: 1, 2, 3, 6, 9, 18
Factors of 24: 1, 2, 3, 4, 6, 8, 12, 24
Common factors: 1, 2, 4 and 6
HCF of 18 and 24 = 6 cm
Thus, lenght of the largest piece that can be cut from the ribbons will be 6 cm.