"Oxidation number" is the charge left on the central atom when all the bonding pairs of electrons are removed with the charge (the electron going to the more electronegative atom. For carbon and hydrogen, CARBON is the more electronegative atom, and if we do this process CONCEPTUALLY on a C-H bond, we would get C^(-) and H^+
So for cyclopropane, we have three methylene, CH_2 units, constrained in a ring. When we break the C-C bonds (i.e. we are doing this conceptually, in our nuts) the 2 electrons in the C-C bond are conceived to be shared by each carbon, and thus have not affect on oxidation number. And so we get 3xxddotCH_2. And since hydrogen is conceived to have a charge of +I, the carbon oxidation numbers are EACH -II.
For "propylene", i.e. H_3C-CH=CH_2, we get oxidation numbers respectively of H_3C^(-III)C^(-I)H=C^(-II)H_2 (and still with the one degree of unsaturation , we get AN AVERAGE oxidation number of -II; i.e. the same as for "cyclopropane".
Normally we don't go thru this tiresome process (I would be surprised if you had to do it as an undergrad). Alcoholic carbons have oxidation number -I, carbonyl carbons, +II "(ketone)", or +I "(aldehydes)", RC^(+III)O_2H, and C^(-IV)H_4.
See here for [oxygen oxidation numbers.](https://socratic.org/questions/what-s-the-oxidation-state-of-oxygen-in-normal-oxides)