cpp continue statement

Continue statement in C

The continue statement is used to skip some statements and go to next iteration of the loop. and the continue statement can be written as follow

continue;

it is generally used with the condition. its force to the next iteration and skipping the code of current iteration or not executes the current statements when continue statement encounter.

The difference between break and continue is that when the break statement is encountered the loop terminates, And when the continue statement is encounter then the loop is not terminate but the next iteration of the loop starts.

/* program to understand the use of continue statement*/
#include < iostream.h >
void main()
{
int i;
for(i=0;i<=10;i++)
{
if(i==5)
continue;
cout << i;
}
return 0;
}

In this example when iteration i value becomes 5 then continue statement encountered and skip the all code for the iteration 5 and go to the next iteration. .

  • Basic OOPS Concepts
  • Benefits of OOPs
  • C++ History
  • C++ Applications
  • C++ features
  • C++ program structure
  • C++ Installation
  • C++ Comments
  • C++ output operator
  • C++ input operator
  • C++ Header files
  • C++ variables
  • C++ Compiling and linking
  • C++ Exercise
  • C++ Tokens
  • C++ Identifiers & constants
  • C++ Data types
  • C++ User defined data type
  • C++ derived Data types
  • C++ Symbolic constant
  • C++ Type compatibility
  • C++ Declaration of variable
  • C++ Reference Variables
  • C++ Exercise
  • C++ operators
  • C++ Scope Resolution operators
  • C++ Member Dereferencing Operator
  • C++ Memory Management operator
  • C++ Manipulators
  • C++ Type Cast Operator
  • C++ Exercise
  • C++ Expressions
  • C++ Special Assignment
  • C++ Implicit Conversions
  • C++ Exercise
  • C++ Operator Overloading
  • C++ Operator Precedence
  • C++ Exercise
  • C++ if statements
  • C++ switch statement
  • C++ Do-while statement
  • C++ while statement
  • C++ for statement
  • C++ Exercise
  • C++ function introduction
  • C++ function prototyping
  • C++ Call by reference
  • C++ Inline function
  • C++ Default Arguments
  • C++ function overloading
  • C++ Math Library Functions
  • C++ Exercise
  • C++ class Introduction
  • C++ structure Revisited
  • C++ Specifying a Class
  • C++ Creating Objects
  • C++ Accessing Class Members
  • C++ Defining Member Functions
  • C++ Nested OF Member Functions
  • C++ Private Member Functions
  • C++ Array with in a class
  • C++ Memory Allocation for objects
  • C++ Static Data Members
  • C++ Array of objects
  • C++ Friendly functions
  • C++ Returning Objects
  • C++ Member Functions
  • C++ Pointer to Members
  • C++ Local Classes
  • C++ Exercise
  • C++ Constructor Introduction
  • C++ Parameterized Constructor
  • C++ Multiple Constructor
  • C++ Dynamic Initialization of Objects
  • C++ Copy Constructor
  • C++ Dynamic Constructor
  • C++ Destructors
  • C++ Exercise
  • C++ Operator Overloading
  • C++ Overloading Unary Operators
  • Const pointer in C
  • Void pointer in c
  • C++ Overloading Binary Operators
  • C++ Overloading Binary Operators Using Friends
  • C++ Manipulation String Using Operators
  • C++ Rules for overloading operators
  • C++ Exercise
  • C++ Basic To class Type
  • C++ Class TO Basic Type
  • C++ One class To another class type
  • C++ Exercise
  • C++ Inheritance introduction
  • C++ Single Inheritance
  • C++ Multiple Inheritance
  • C++ Ambiguity Resolution in inheritance
  • C++ Hierarchical Inheritance
  • C++ Hybrid Inheritance
  • C++ Virtual Base Classes
  • C++ Exercise
  • C++ abstract class
  • C++ nesting of classes
  • C++ Exercise
  • C++ polymorphism
  • C++ Exercise
  • C++ pointers
  • C++ Pointers TO object
  • C++ this pointer
  • C++ Pointer to Derived class
  • C++ Virtual functions
  • C++ Exercise
  • C++ streams
  • C++ unformatted I/O operations
  • C++ Put() and get()
  • C++ getline() and write()
  • C++ Formatted console I/O
  • C++ Manipulators
  • C++ Exercise
  • C++ file handling
  • C++ file stream classes
  • C++ Open and closing file
  • C++ open using constructor
  • C++ open using open()
  • C++ Detecting End of file
  • C++ File modes
  • C++ File pointers and Manipulators
  • C++ Sequential I/O
  • C++ Reading and Writing
  • C++ Updating a File
  • C++ Error handling In File
  • C++ Command Line Arguments
  • C++ Exercise
  • C++ Template introduction
  • C++ Class Templates with multiple Parameters
  • C++ Function templates
  • C++ Function templates with multiple parameters
  • C++ member function Template
  • C++ Exercise
  • C++ Exception handling
  • C++ Basics of Exception Handling
  • C++ Exception Handling Mechanism
  • C++ Throwing Mechanism
  • C++ Catch Mechanism
  • C++ Catch all Exceptions
  • C++ Re-Throwing An Exception
  • C++ Specifying Exceptions
  • C++ Exercise