Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

Continue statement in C programming Language

Posted on January 6, 2018September 22, 2019

Table of Contents

  • Continue statement in C Language
      • Control flow of continue in while_loop
    • Continue  in for loop
    • Continue  in while loop
    • Continue  in do-while loop
    • Related

Continue statement in C Language

In this article, we discuss the concept of the continue statement in C Language and how to use continue  in C language

The continue is used to skip one or more statements inside the loop in C programming language. The continue statement is used to move the program control at the beginning of the loop and it is used inside the  if…else clause(decision marking statement). Although the continue statements function like break statements(skip one or more line of code), they are not the same.

Syntex in continue statements

continue;

flow chart of continue statements

Control flow of the continue in for loop

Control flow of continue in while_loop

Control flow of continue in while_loop

Continue  in for loop

We can use the continue statements with for loop. When we use continue statements in for loop, some codes are skipped and control moves to the beginning of the program.
Program 1


When the above code is executed, The following output displays

1
2
3
4
skipped value :5
6
7
8
9
10
End of loop!

Number 5 is skipped in this serious of element by the continue statement

Program 2


When the above code is executed, The following output displays


Number 10 is skipped in this addition by the continue statement

Continue  in while loop

 

We can use the continue statements with while loop. When we use continue statements in while loop, some codes are skipped and control moves to the beginning of the program.

Program


When the above code is executed, The following output is displayed

1
2
3
4
5
skipped value :6
7
8
9
10
End of loop!

Number 6 is skipped in this serious of element by the continue statement

Program2


When the above code is executed, The following output displays


Number 25 is skipped in this addition by the continue statement

Continue  in do-while loop

 

We can use the continue statements with do-while loop. When we use continue statements in do- while loop, some codes are skipped and control moves to the beginning of the program.

Program 1

#include <stdio.h>
#include <stdlib.h>

int main()
{
int i=0;
    do{
        if(i==5){
  i++;
        continue;
        }
        printf("%d",i);
i++;
    }
    while(i<=10);

    printf("\nEnd of loop!\n");
    getch();
    return 0;
}

When the above code is executed, The following output displays

01234678910
End of loop!

Number 5 is skipped in this serious of element by the continue statement

Similar post

Break-in C Language

Continue in Python

Pass statement in Python

Break statement in Python

 

 

Related

Recent Posts

  • Multiply two numbers in Java using scanner| 5 different ways
  • 5 different ways to Divide two numbers in Java using scanner
  • Learn 8 Ways to Subtract Two Numbers Using Methods in Java
  • 10 ways to subtract two numbers in Java
  • Java Code Examples – Multiply Two Numbers in 5 Easy Ways
  • How to Divide two numbers in Java| 5 different ways

tag

Addition (8) Array (38) C++ language (91) C language (98) c sharp (23) Division (8) Function (29) if else (32) Java language (108) JavaScript (5) loops (138) Multiply (8) Oop (2) patterns (66) PHP (13) Python Language (38) Subtraction (9) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2026 Code for Java c | Powered by SuperbThemes