Skip to content

Instantly share code, notes, and snippets.

@sojohnnysaid
Created December 17, 2017 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sojohnnysaid/4ebe5d39c1884d4db2cb3730fb644555 to your computer and use it in GitHub Desktop.
Save sojohnnysaid/4ebe5d39c1884d4db2cb3730fb644555 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void)
{
// example of a simple while loop
// code will continue to execute within the
// while loop brackets until countdown is equal to 0
int countdown = 10;
while (countdown != 0)
{
printf("%d!\n", countdown);
countdown--; // very important we decrement countdown
}
// once out of the while loop our program continues...
printf("happy new year!\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment