4 ms·
Whether you print the number, Fizz, Buzz or FizzBuzz you are going output a line break, so I'm not sure what you would be checking for. Output \n unconditionall
by boomlinde 12y ago
Whether you print the number, Fizz, Buzz or FizzBuzz you are going output a line break, so I'm not sure what you would be checking for. Output \n unconditionally.
- deleted 12y ago[deleted]
- zem 12y agothen you'd get \n \n fizz\n \n buzz\n rather than fizz\n buzz\n
- blt 12y agoThen you call `printf` twice every loop instead of once. `printf` is buffered so you aren't making two system calls, but you are still making two function calls.
- boomlinde 12y agoMaybe it's a performance/brevity compromise, but the latter is the issue the I addressed. The least-calls solution would probably be to print the whole output as a single string constant.