With Chlorine — MCl2
With Sulphur — MS
Explanation:
Given, M reacts with oxygen to form an ionic bond MO. Oxygen needs 2 electrons to complete its octet forming the anion O2-. As the compound formed is MO, it means that M has 2 electrons in its valence shell which it donates to Oxygen to attain a stable electronic configuration forming a cation M2+.
Each Chlorine atom accepts 1 electron to complete its octet so 2 Chlorine atoms combine with 1 atom of M to form MCl2. Each Sulphur atom accepts 2 electrons to complete its Octet so 1 Sulphur atom combines with 1 atom of M to form MS.