Plants primarily obtain the nitrogen they need from the soil through a symbiotic relationship with nitrogen-fixing bacteria living in their roots. These bacteria convert atmospheric nitrogen into a form that plants can absorb and utilize for their growth and development.
So, the correct answer is C - from bacteria living in their roots.