One can observe that the given compounds belong to the “alkyne” family, where the molecular formula can be generally represented as CnH2n-2. Here, ‘n’ denotes the number of carbon atoms.
For a molecule with 5 carbon atoms, n=5 and hence the molecular formula will be C5H2x5-2 or C5H8 (pentyne)