Calculate mole fraction in a mixture.
Mole fraction is the moles of one component divided by the total moles of everything present, so it is dimensionless and the fractions of all components necessarily sum to one. That property makes it the natural composition variable for the laws that describe mixtures: Raoult's law gives each component's vapour pressure as its mole fraction times its pure-component pressure, Dalton's law gives its partial pressure as its mole fraction times the total, and colligative properties such as freezing-point depression depend on mole fraction rather than mass. Unlike molarity, mole fraction does not change when the mixture is heated, because no volume is involved.
Mole fraction of each component
Total moles = nA + nB + nC; mole fraction of A = nA / total, and likewise for B and C, so that the three fractions sum to 1
Molarity is moles per litre of solution and shifts with temperature because volume does. Mole fraction is a ratio of amounts, so it is temperature-independent and is what the gas and solution laws actually require.
Leave the third at zero. The two remaining fractions will still sum to one, and a binary mixture is the most common case in Raoult's law problems.
Convert each mass to moles first by dividing by its own molar mass. Using masses directly gives mass fraction, which is a different quantity and will not satisfy the gas laws.