8 ms·
Don't ruin that version with an if statement. Use this and avoid it( and the second array as well ): char * a[] = { "%d\n" , "Fizz\n" , "Buzz\n" , "FizzBuzz
by rhth54656 12y ago
Don't ruin that version with an if statement.
Use this and avoid it( and the second array as well ):
char * a[] = { "%d\n" , "Fizz\n" , "Buzz\n" , "FizzBuzz\n" } ;
- acqq 12y agoBrilliant, thanks! The C version is now: int i; char* a[] = { "%d\n", "Fizz\n", "Buzz\n", "FizzBuzz\n" }; for ( i = 1; i < 101; i++ ) printf( a[ (i%5==0)*2 + (i%3==0) ], i );