What is the mass of 1 atom of carbon? I know that relative atomic mass of $\ce{^{12}C}$ is $12~\mathrm{u}$.

Therefore mass of $1~\mathrm{mol}~\ce{C} = 12~\mathrm{g}$
\begin{align}
 \text{mass of }6.022\cdot 10^{23} \text{ C atoms} &amp;= 12~\mathrm{g}\\ 
 \text{mass of }1 \text{ C atom} &amp;= \frac{12~\mathrm{g}}{6.022\cdot10^{23}}\\
&amp;=\boxed{1.99\cdot10^{-23}~\mathrm{g}},\\
\end{align}

but

\begin{align}
 1~\mathrm{u} &amp;= 1.66\cdot10^{-24}~\mathrm{g}\\
\implies \text{Mass of }1~\ce{^{12}C}\text{ atom} &amp;= 1.66\cdot 12 \cdot 10^{-24}~\mathrm{g}\\
&amp;= 19.92\cdot 10^{-24}~\mathrm{g}\\
&amp;= 1.992\cdot 10^{-23}~\mathrm{g}.\\
\end{align}

Which is correct?

Also what is dimension formula of relative atomic mass, molar mass? 

Why is unit of molar mass $\dfrac{\text{gram}}{\text{mole}}$ and not just $\text{gram}$ Since when has this $\text{mol}$ become a unit? It's just a number.
Both approaches are correct.  

Avogadro's number is $6.02214129\times 10^{23}$ and represents the number of carbon-12 atoms in 12 grams of unbound carbon-12 in the ground electronic state. 

$12$grams$/6.02214129\times 10^{23} = 1.9926467\times 10^{-23}$grams

The unified atomic mass unit (u) is $1.660538921 \times 10^{-24}$ grams

$12 \times 1.660538921 \times 10^{-24}$ grams $ = 1.9926467\times 10^{-23}$grams