From here:
Each of these letters has a hard sound
hard c sound (kuh): cat, cup
hard g sound (guh): gap, goat
As well as a soft sound.
soft c sound (suh): cell, city
soft g sound (juh): gerbil, gym
Usually, a c or g sound is hard or soft depending on the vowel that follows it. Here's the general rule:
1. When c or g meets a, o, or u, its sound is hard:
cap, cave, colt, comedy, curly, cuddle
gas, gather, goblet, goddess, gum, gutter
2. When c or g meets e, I, or y, its sound is soft.
census, center, circle, citizen, cycle, cymbal
gel, general, giant, ginger, gypsy, gyrate
.