Step 1: Given the empirical formula of the organic compound is C\(_4\)H\(_8\)O, and it forms a yellow precipitate with iodine in NaOH solution. The reaction between iodine and NaOH leads to the formation of a yellow precipitate (iodoform), which occurs when a methyl ketone or an alcohol with a methyl group attached to the carbonyl group is present.
Step 2: Checking the options:
- Option (1) \( \text{CH}_3 \text{CH}_2 \text{CHO} \) is an aldehyde, but it would not give a yellow precipitate with iodine under these conditions.
- Option (2) \( \text{CH}_2 = \text{CH} \text{CH(OH)} \text{CH}_3 \) is an alcohol with the required structure to undergo the iodoform reaction.
- Option (3) \( \text{CH}_3 \text{CH}_2 \text{COOH} \) is a carboxylic acid and would not form iodoform.
- Option (4) \( \text{CH}_3 \text{CH}_2 \text{O} \text{CH}_2 \) does not match the given empirical formula or reaction.
Thus, the compound X is option (2), \( \text{CH}_2 = \text{CH} \text{CH(OH)} \text{CH}_3 \).