  We present results on rapidity and transverse momentum distributions of
inclusive charm quark production in hadronic and heavy-ion collisions at RHIC
and LHC energies, including the next-to-leading order, $O(\alpha_s^3)$,
radiative corrections and the nuclear shadowing effect. We determine the
hadronic and the {\it effective} (in-medium) K-factor for the differential and
total inclusive charm cross sections. We show that these K-factors have strong
$p_T$ dependence. We discuss how measurements of charm production at RHIC and
LHC can provide valuable information about the gluon density in a nucleus.
