Goto statements are used to make unconditional jumps. Without testing any condition, the control can be transferred from one point to another point in the program. The use of goto is highly discouraged in a powerful structured programming language like C.
The label can be named according to the user's wish provided it follows the naming rules.
Example: Read n letters containing both uppercase and lowercase letters. Write out the letters with uppercase and lowercase letters reversed, but all other characters intact.
int main( )
printf("Enter the number of characters:");
repeat: // here repeat is the label or name of the location where
printf("Enter a character:"); the goto statement can transfer the control to.
The number of characters to be converted is got from the user in the variable n. Then a character is read and converted to its reverse case. After this, the count variable which is initially zero is incremented and checked whether it is less than n. If so, the above-said operations have to be repeated (reading a char, converting it and displaying). Hence, the point where the reading starts is given a name or label(repeat) and the control is transferred to that point again and again as long as the count is less than n.