Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

goto is good

Name: Anonymous 2012-06-11 22:02

if you think otherwise you're a trendfag. goto is far more efficient than function calls for short blocks of code (lol compiler ignoring inline) and have a lot of neat applications.

Name: Anonymous 2012-06-11 22:27

i know i'm dumb, but this is the only way i could figure out fizz buzz without a separate case

void fizz_buzz(int upto)
{
  int i = 1;
  while(i != upto+1)
  {
    if(i % 3 == 0)
    {
      printf("%s", "Fizz");
    }
    else
      goto not_multiple_of_3;

    if(i % 5 == 0)
    {
      printf("%s", "Buzz");
    }
    goto new_line;

not_multiple_of_3:
    if(i % 5 == 0)
    {
      printf("%s", "Buzz");
      goto new_line;
    }
    printf("%d", i);

new_line:
    printf("\n");

    i++;
  }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List