The oppositely charged metal M and non-metal chloride ions attract each other and ionic bonds are formed.
Formula of the compound when M combines with sulphur = MS
Formula of the compound when M combines with oxygen =MO
Formula of the compound when M combines with nitrogen =M3 N2