CodersEditor Tutorials

CodersEditor Tutorials

  • Online IDE
  • Q&A
  • C Programming
  • Java
  • GraphQL.NET
  • System Software

›Loop

C Programming

    Introduction

    • Overview
    • Installation & Setup
    • C Program Structure
    • Keywords & Identifiers
    • Data Types
    • Variables & Constants
    • Scope Rules
    • Storage Class
    • Standard Input and Output
    • Operators

    Control Flow/Decision Making

    • Overview
    • if Statement
    • if else Statement
    • Nested If statement
    • Switch Statement
    • Nested Switch Statement
    • Conditional Operators

    Loop

    • Loops Overview
    • While loop
    • For Loop
    • Do while
    • Nested Loops
    • Break
    • Continue Statement
    • Goto statement

    Arrays

    • Arrays
    • Multi Dimensional Arrays
    • Arrays & Functions

    Pointers

    • Pointers Basics
    • Pointers and Arrays
    • Pointers and Functions
    • Memory allocation

    Strings

    • String Basics
    • String Functions

    C Programming Examples

    • Basic Example 1

Continue Statement in C

In this article, you will come to know about the continue statement in C and how it works in the program.

Continue Statement in C

The continue statement skips the current iteration of the loop and forces the next iteration of the loop to take place. Continue is a loop control statement just opposite to that of the break statement, as it forces the next iteration of the loop to execute by skipping the code in between.

The continue statement is mainly used for a condition so that we can skip some code for a particular condition. It is mostly used with the if..else statement.

Syntax

 continue;

Example

#include <stdio.h> 
int main() 
{  
    for (int i = 0; i < 10; i++)
    {  
        if (i == 5)  
        continue;  
        else 
        printf("%d ", i);  
    }  
    return 0;  
} 
Output
0 1 2 3 4 6 7 8 9

The above example is a program of printing a series of numbers with an exception(i.e. 5 here).

So when the value of i becomes 5 it skips that particular iteration and proceeds with the next as we have given the continue statement for the condition if (i == 5).

← BreakGoto statement →
  • Continue Statement in C
  • Syntax
  • Example
CodersEditor Tutorials
CoderdEditor Developer Tools
CodersEditor Online EditorGit Flavoured Markup EditorFree Online JSON FormatterFind My IP Address Details
Tutorials
C ProgrammingJava
Copyright © 2021 CodersEditor.com