Skip to content

Instantly share code, notes, and snippets.

@ntcho
Created April 10, 2017 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntcho/12df7b1ac6bf0a5130cb28850adf44d8 to your computer and use it in GitHub Desktop.
Save ntcho/12df7b1ac6bf0a5130cb28850adf44d8 to your computer and use it in GitHub Desktop.
C++ Loops
int main() {
int i = 0, j = 0, k = 0;
// for statement
for (i = 0; i < 5; i++) {
print(i);
}
// while statement
while (j < 5) {
print(j++);
}
// do while statement
do {
print(k++);
} while (k < 5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment