Created
May 20, 2014 18:09
-
-
Save efernandesng/d721468d443136b20ee3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
static int inicial = 1; | |
static int final = 5; | |
int | |
main (int argc, char **args) | |
{ | |
int cont = 0; | |
int pos = inicial; | |
while (pos <= final && cont <= final) | |
{ | |
printf ("%d ", pos); | |
if (cont == pos - 1) | |
{ | |
pos++; | |
cont = 0; | |
} | |
else | |
cont++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment