In C, jump statements are used to jump from one part of the code to another altering the normal flow of the program. They are used to transfer the program control to somewhere else in the program.
Break Statement in C
The break statement exits or terminates the loop or switch statement based on a certain condition, without executing the remaining iteration of the loop or checking remaining cases in switch statement.

The following is an example of break statement. It moves the control out of loop when i becomes 6.
#include <stdio.h>
int main()
{
int i;
// for loop
for (i = 1; i <= 10; i++) {
// when i = 6, the loop should end
if (i == 6) {
break;
}
printf("%d ", i);
}
printf("Loop exited.\n");
return 0;
}
Output
1 2 3 4 5 Loop exited.
Explanation:
- Loop Execution Starts and goes normally till i = 5.
- When i = 6, the condition for the break statement becomes true and the program control immediately exits the loop.
- The control continues with the remaining statements outside the loop.
Uses of break in C
The break statement is used in C for the following purposes:
- To come out of the loop.
- To come out of the switch case.
Note: If the break statement is used inside an inner loop in a nested loop, it will break the inner loop without affecting the execution of the outer loop.
Note: The break statement only breaks a single loop per usage. If we want to exit multiple loops in nested loops, we have to use multiple break statements for each of the loop.
The break statement is also used inside the switch statement to terminate the switch statement after the matching case is executed.
Continue Statement in C
The continue statement in C is used to skip the remaining code after the continue statement within a loop and jump to the next iteration of the loop. When the continue statement is encountered, the loop control immediately jumps to the next iteration, by skipping the lines of code written after it within the loop body.
Note: Just like break, the continue statement also works for one loop at a time.

The following is an example of continue statement.
// C Program to illustrate the continue statement
#include <stdio.h>
int main()
{
int i;
// loop
for (i = 0; i < 5; i++) {
if (i == 2) {
// continue to be executed if i = 2
printf("Skipping iteration %d\n", i);
continue;
}
printf("Executing iteration %d\n", i);
}
return 0;
}
Output
Executing iteration 0 Executing iteration 1 Skipping iteration 2 Executing iteration 3 Executing iteration 4
Explanation: The for loop iterates from 0 to 4. Inside the loop, we check if i is equal to 2. If the condition is true, the continue statement is executed, and it skips the remaining code within the loop for that iteration. If the condition is false, the code proceeds normally.
Note: While using continue in loop, we have to make sure that we put the continue after the loop variable updation or else it will result in an infinite loop.
Goto Statement in C
The goto statement is used to jump to a specific point from anywhere in a function. It is used to transfer the program control to a labeled statement within the same function.
Syntax of goto Statement
goto label;
.
.
label:
// code
Flowchart of goto Statement

Here is an example to check if a number is odd or even using goto statement.
#include <stdio.h>
void checkEvenOrNot(int num) {
if (num % 2 == 0)
// jump to even
goto even;
else
// jump to odd
goto odd;
even:
printf("%d is even", num);
return;
odd:
printf("%d is odd", num);
return;
}
int main() {
int num = 26;
checkEvenOrNot(num);
return 0;
}
Output
26 is even
Note: The use of goto is generally discouraged in the programmer's community as it makes the code complex to understand.
Return Statement in C
The return statement in C ends a function and sends control back to the caller, optionally returning a value. It does not need a condition, returns no value in a void function, and must return a value in a non-void function.
#include <stdio.h>
int add(int a, int b) {
int sum = a + b;
// Return the sum as the result of the
// function
return sum;
}
void printMessage() {
// Return from the function with no value (void)
printf("GeeksforGeeks\n");
return;
}
int main() {
int result = add(5, 3);
printf("Result: %d\n", result);
printMessage();
return 0;
}
Output
Result: 8 GeeksforGeeks