Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created March 20, 2017 16:44
Show Gist options
  • Save AndyNovo/83d30fb756e54edac1526eaf5db3f03f to your computer and use it in GitHub Desktop.
Save AndyNovo/83d30fb756e54edac1526eaf5db3f03f to your computer and use it in GitHub Desktop.
Basic C loop
#include "stdio.h"
int main() {
int i;
//The first part of this for loop is run once as an initialization
//the second part is checked for truth at the end of each execution to determine if the loop should be run again
//the third part is executed at the end of the loop (typically used to increment something)
for (i = 0; i < 5; i++){
printf("i = %d\n", i);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment