Sowas gibt es, es nennt sich "Funktion"

Ich würde dir ein C-Tutorial oder Buch empfehlen.

Gruß, Yaro