To calculate the moles of each element in methane:
We will use the avogadros number.
For C:
1 mole = 6.022x10^23 atoms
in CH4 there is only 1 carbon.
Which is 1 x 6.022x10^23 atoms = 1 mole
There is 1 moles of carbon.
For H:
For hydrogen its 4 x 6.022x10^23 atoms = 4 moles
therefore there are 4 moles of hydrogen.