We analyzed the atomic and electronic structures in relaxed ${\mathrm{Si}}_{1\ensuremath{-}x\ensuremath{-}y}{\mathrm{Ge}}_{x}{\mathrm{C}}_{y}$ crystals using first-principles total energy calculations. First, to investigate the dependence of properties on C and Ge concentrations, uniform alloys with $y=0,$ 0.0625, 0.125, and 0.5 were examined. It was found that the total energy when C atoms are surrounded by Si atoms (Type $A)$ is lower than that when they are surrounded by Ge atoms (Type $B)$ because of the larger gain in chemical binding energy in spite of the larger distortion energy. The band gaps are reduced for $y=0.0625$ and 0.125 from those for $y=0,$ indicating a finite gap (semiconductor) for Type-$A$ structure but no band gap for Type-$B$ structure. In the semiconducting alloys of Type A, the effective masses of heavy holes become smaller. The alloy crystals with $y=0.0625$ have direct band gaps, and the oscillator strengths of the optical transition between the band-edge states are much larger than for ${\mathrm{Si}}_{1\ensuremath{-}x}{\mathrm{Ge}}_{x}$ systems without a C atom, because of the C s-orbital component in the bottom of the conduction bands. Next, to extend these results to random alloys, five C arrangements of ${\mathrm{Si}}_{1\ensuremath{-}y}{\mathrm{C}}_{y}$ alloys were examined. The reduction of effective hole mass does not depend on the C arrangements. Every crystal has a direct band gap with C s-orbital component at the conduction-band bottom, leading to high-optical transition as in the uniform alloy. Finally, the band structure of the alloys were systematically described based on the tight-binding expression, which speculated that the band gap of the random alloy might be larger than that of the uniform alloy.