Well, we has #stackrel(-II)O=stackrel(+II)C=stackrel(0)C=stackrel(+II)C=stackrel(-II)O#. The sum of the oxidation numbers is ZERO, as it required for a neutral molecule. The average carbon oxidation number is #+4/3#. Do you agree?
By definition, the oxidation number is the charge left on the central atom when all the bonds are broken with the charge, the electrons, devolved to the most electronegative atom (in the case oxygen). If we break a homonuclear bond, i.e. #C-C# or #O-O#, we assume that the two electrons are SHARED between the elements comprising the bond.
With these ideas, we can assign oxidation numbers for organic molecules, where we normally do not assign oxidation number: for methane, #stackrel(+I)H_4stackrel(-IV)C#, for methyl halide
, #stackrel(-I)Xstackrel(+I)H_3stackrel(-IV)C#, for ethane, #H_3stackrel(-III)C-CH_3#, for propane, #H_3stackrel(-III)C-stackrel(-II)CH_2CH_3#, for neopentane
, #(H_3stackrel(-III)C-)_4stackrel(0)C#. Do you see from where I am coming? You usually will not be asked to do this in organic chemistry, however, I include it as a curiosity.
What are the individual oxidation numbers for carbon in #H_3C-CO_2H#? What about oxygen in hydrogen peroxide, #H-O-O-H#?