Continuing to the Next Loop - C++ Statement

C++ examples for Statement:continue

Description

Continuing to the Next Loop

Demo Code

#include <iostream> 
   //from  w w w. j a v a  2s .co m
int main() 
{ 
    int counter = 0; 
    int multiples = 0; 
   
    while (multiples < 19) 
    { 
           counter++; 
           if (counter % 15 != 0) 
                continue; 
           std::cout << counter << " "; 
           multiples++; 
    } 
 
    std::cout << "\n"; 
    return 0; 
}

Result


Related Tutorials