How are both squawk and altitude transmited when operating a Transponder in Mode C?
Squawk codes (Mode A replies) are transmitted in response to Mode 3/A interrogations. Altitude codes (Mode C replies) are transmitted in response to Mode C interrogations.
Both Mode A and C replies use the same 12 pulse encoding, but the radar that asked the question knows how to interpret the answer (assuming there is no FRUIT or garbling, but that is another topic).
If the transponder is in altitude reporting mode (i.e. it replies to Mode C interrogations), it will also reply to Mode 3/A interrogations.
Thus, if you squawk 7700 and you transponder is switched on (either Mode A only or Mode A/C), then code 7700 will be the response to the next Mode A interrogation from a radar. If your transponder responds to Mode C interrogations as well (i.e. altitude reporting is on), the radar will receive altitude information in response to Mode C interrogations.