Calculate percentage composition of nitrogen in amammonia

Ammonia is NH3.

The mass composition is the ratio of atomic masses (AM) within the molecule, i.e.
mass composition of nitrogen
=AM(N)/(AM(N)+3AM(H))
=14.0067/(14.0067+3*1.0079)
=0.822 approximately.