Skip to content

Instantly share code, notes, and snippets.

@chee
Forked from anonymous/my while loop
Created January 14, 2010 19:54

Revisions

  1. chee revised this gist Jan 14, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion my while loop
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ main()
    int age, legal;

    age = 10;
    # Britishising.
    // Britishising.
    legal = 18;

    while (age < legal){
  2. chee revised this gist Jan 14, 2010. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions my while loop
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,7 @@ main()
    int age, legal;

    age = 10;
    # Britishising.
    legal = 18;

    while (age < legal){
  3. chee revised this gist Jan 14, 2010. 1 changed file with 11 additions and 8 deletions.
    19 changes: 11 additions & 8 deletions my while loop
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,21 @@
    #include <stdio.h>

    /* just practicing my while loops */
    /* just forking yr while loops */
    main()
    {
    int age, legal;

    age = 10;
    legal = 21;
    legal = 18;

    while (age != 21){
    printf("%s %d %s", "you can not drink yet because you are", age, "years old\
    \n");
    age = age + 1;
    while (age < legal){
    printf("You cannot drink yet because you are only %i years old\n", age);
    sleep(1);
    age++;
    }
    printf("%s %d %s", "you can legally drink now because you are" ,age, "years o\
    ld\n");
    printf("Now you can drink, because you're %i years old.\n\n", age);
    sleep(1);
    printf("Not that you weren't drinking already.\n\n"
    sleep(2);
    printf("\t\tYou waster.\n");
    }
  4. @invalid-email-address Anonymous created this gist Jan 14, 2010.
    18 changes: 18 additions & 0 deletions my while loop
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #include <stdio.h>

    /* just practicing my while loops */
    main()
    {
    int age, legal;

    age = 10;
    legal = 21;

    while (age != 21){
    printf("%s %d %s", "you can not drink yet because you are", age, "years old\
    \n");
    age = age + 1;
    }
    printf("%s %d %s", "you can legally drink now because you are" ,age, "years o\
    ld\n");
    }