Skip to content

Instantly share code, notes, and snippets.

@kjk
Created November 7, 2019 07:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kjk/cb46da4aa9b83d6433c71476ce1bbea0 to your computer and use it in GitHub Desktop.
// :glot
#include <iostream>
using namespace std;
auto main() -> int
{
for (int i = 0; i < 6; i++)
{
if (i % 2 == 0) // evaluates to true if i is even
continue; // this will immediately go back to the start of the loop
/* the next line will only be reached if the above "continue" statement
does not execute */
std::cout << i << " is an odd number\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment