Search
 
SCRIPT & CODE EXAMPLE
 

CPP

continue c++

     Continue statement is used inside loops. Whenever a continue statement is
encountered inside a loop, control directly jumps to the beginning of the loop
for next iteration, skipping the execution of statements inside loop’s 
body for the current iteration.
Comment

continue statement in c++ program

/*Q: Design a program to print the employee IDs from 1 to 15 and skip the
IDs 7 and 10 because they have resigned.*/
#include<iostream>
using namespace std;
int main()
{
	int meet=0;
	for(int i=1;i<=15;i++)
	{
		if(i==7||i==10)
			continue;
	cout<<"Employe ID="<<i<<endl;			
	}
}
Comment

C++ continue with for loop

// program to print the value of i

#include <iostream>
using namespace std;

int main() {
    for (int i = 1; i <= 5; i++) {
        // condition to continue
        if (i == 3) {
            continue;
        }

        cout << i << endl;
    }

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ saying hello world 
Cpp :: vector library c++ 
Cpp :: how to say hello world in c++ 
Cpp :: binary search in c++ 
Cpp :: how to remove first element from vector c++ 
Cpp :: c++ pre-processor instructions 
Cpp :: size() in c++ SET 
Cpp :: find a number in vector c++ 
Cpp :: array of struct in c++ 
Cpp :: c++ get last element in vector 
Cpp :: how to format decimal palces in c++ 
Cpp :: C++ Nested if...else 
Cpp :: how to initialize a queue in c 
Cpp :: c++ vector first element 
Cpp :: exponent power of x using c c++ 
Cpp :: how to input in cpp 
Cpp :: rock paper scissor c++ 
Cpp :: disallowcopy c++ 
Cpp :: Lambda capture as const cpp 
Cpp :: c++ little endian or big endian 
Cpp :: what was the piep piper app 
Cpp :: how to use for c++ 
Cpp :: C++ Quotient and Remainder 
Cpp :: Program to print full pyramid using 
Cpp :: Split a number and store it in vector 
Cpp :: select elements from array C++ 
Cpp :: cin c++ 
Cpp :: Shell-Sort C++ 
Cpp :: use declaration to define a variable 
Cpp :: cout in c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =