The compound should have CH3 CO-group to show the iodoform test. Acetophenone (C6H5 COCH3) contains the group CH3 CO attached to carbon and hence given iodoform test while benzophenone does not contain this group and hence does not give iodoform test.
C6H5 COCH3 (Acetophenone) + 3I2 + 4 NaOH → CHI3 + C6 H5 COONa (Iodoform) + 3 NaI + 3 H2O
C6 H5 COC6H5 + I2 + NaOH → No reaction