Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #continue #loop
ADD COMMENT
Topic
Name
2+2 =