  We have studied the changes in the electronic structure and the
superconducting transition temperature T_c of Mg(B_{1-x}C_{x})_{2} alloys as a
function of x with 0\leq x\leq 0.3. Our density-functional-based approach uses
coherent-potential approximation to describe the effects of disorder,
Gaspari-Gyorffy formalism to estimate the electron-phonon matrix elements and
Allen-Dynes equation to calculate T_c in these alloys. We find that the changes
in the electronic structure of Mg(B_{1-x}C_{x})_{2} alloys, especially near the
Fermi energy E_F, come mainly from the outward movement of E_F with increasing
x, and the effects of disorder in the B plane are small. In particular, our
results show a sharp decline in both B and C p_{x(y)} states for 0.2\leq x\leq
0.3. Our calculated variation in T_{c} of Mg(B_{1-x}C_{x})_{2} alloys is in
qualitative agreement with the experiments.
