Fizz buzz Fizzbuzz

GIVE ME MY FIZZBUZZ

void fizzbuzz() {
for(int i=1;;i++) {
String s = i%3==0?"fizz":"";
s += i%5!=0?"":"buzz";
System.out.println(s.isEmpty()?i:s);
}
}

Other urls found in this thread:

pastebin.com/raw/WjbiGNEC
twitter.com/SFWRedditGifs

perl -e 'say"Fizz"x!($_%3)."Buzz"x!($_%5)||$_ for 1..100'

#!/usr/bin/env xcrun swift -I

print((1...100).map{ $0 % 3 == 0 ? $0 % 5 == 0 ? "FizzBuzz" : "Fizz" : $0 % 5 == 0 ? "Buzz" : "\($0)"})

what's the point of these threads? there's no challenge whatsoever in writing fizzbuzz.

Yeah, it's the most basic of programming tasks. But who gives a shit.

python2
for x in range(100): print x%3/2*'Fizz'+x%5/4*'Buzz' or x+1

newfag

for(i=1;i

int *ptr

What?

I'm using javascript

Then I am afraid pointers will be of no use to you.

using namespace std;


int main() {
int i;

i = (5/5) - 1;
i *= 0;

cin >> i;
i = 0;

for(int i = 0; i < 25; i++){
if(i == 15)
cout

Here's a pointer: don't use that font, please.

Fixd for you btw

for(i=1;i

fugg thats hot

Alternative because I was bored

for(i=1;i

I'm bored. Now I'm going to bed. Here's what I could come up with for you.

for(i=1;i

>not providing glorious hex magic value solution
function fizzbuzz(n) {
let m = [null, "Fizz", "Buzz", "FizzBuzz"];
let v = 0x30490610;
for (let i = 1; i > 2) | (v & 3)

package fb;

class FizzBuzz {

private static final FIZZ = "fizz";
private static final BUZZ = "buzz";
private int n;

public FizzBuzz(int n) {
this.n = n;
}

public void run() {
for (int i=0; i

Forgot the type on the constants. Should be this instead:
package fb;

class FizzBuzz {

private static final String FIZZ = "fizz";
private static final String BUZZ = "buzz";
private int n;

public FizzBuzz(int n) {
this.n = n;
}

public void run() {
for (int i=0; i

I hate that mine is too long for these threads pastebin.com/raw/WjbiGNEC

for (int i = 1; i < 100; i++) {
String str = "";
if (i % 3 == 0) {
str += "Fizz";
}
if (i % 5 == 0) {
str += "Buzz";
}
if (str.equals("")) {
str = i + "";
}

System.out.println(str);
}