Skip to content

Instantly share code, notes, and snippets.

@sojohnnysaid
Created December 17, 2017 00:39
Embed
What would you like to do?
#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