Skip to content

Instantly share code, notes, and snippets.

@ejknapp
Created January 30, 2014 21:33
Show Gist options
  • Save ejknapp/8720346 to your computer and use it in GitHub Desktop.
Save ejknapp/8720346 to your computer and use it in GitHub Desktop.
Loop demo
//
// main.c
// Loops
//
// Created by Eric Knapp on 1/30/14.
// Copyright (c) 2014 Eric Knapp. All rights reserved.
//
#include <stdio.h>
int main(int argc, const char * argv[])
{
for (int outer = 0; outer < 7; outer++) {
for (int inner = 0; inner < outer + 1; inner++) {
printf("*");
}
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment