[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Alright guys! Fizzbuzz time. Write a program that prints the

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 2
File: 1467659864098[1].jpg (12 KB, 362x270) Image search: [Google]
1467659864098[1].jpg
12 KB, 362x270
Alright guys! Fizzbuzz time.

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. You are not allowed to use if statements/conditionals loops, arrays, recursion, literals, or data structures! Good luck
>>
cout << 1 << endl;
cout << 2 << endl;
cout << Fizz << endl;
cout << 4 << endl;
cout << Buzz << endl;
cout << Fizz << endl;
cout << 7 << endl;
cout << 8 << endl;
cout << Fizz << endl;
cout << Buzz << endl;
cout << 11 << endl;
cout << Fizz << endl;
cout << 13 << endl;
cout << 14 << endl;
cout << FizzBuzz << endl;
>>
>>55420614
>You aren't allowed to code. Good luck!
>>
File: op.jpg (84 KB, 533x700) Image search: [Google]
op.jpg
84 KB, 533x700
>>
>>55420712
here op
https://0x0.st/AJK.hs
acces franklin
>>
program fizzbuzz

begin
writeln(1);
writeln(2);
writeln('Fizz');
writeln(4);
writeln('Buzz');
writeln('Fizz');
writeln(7);
writeln(8);
writeln('Fizz');
writeln('Buzz');
writeln(11);
writeln('Fizz');
writeln(13);
writeln(14);
writeln('FizzBuzz');
writeln(16);
writeln(17);
writeln('Fizz');
writeln(19);
writeln('Buzz');
writeln('Fizz');
writeln(22);
writeln(23);
writeln('Fizz');
writeln('Buzz');
writeln(26);
writeln('Fizz');
writeln(28);
writeln(29);
writeln('FizzBuzz');
writeln(31);
writeln(32);
writeln('Fizz');
writeln(34);
writeln('Buzz');
writeln('Fizz');
writeln(37);
writeln(38);
writeln('Fizz');
writeln('Buzz');
writeln(41);
writeln('Fizz');
writeln(43);
writeln(44);
writeln('FizzBuzz');
writeln(46);
writeln(47);
writeln('Fizz');
writeln(49);
>>
>>55421099
writeln('Buzz');
writeln('Fizz');
writeln(52);
writeln(53);
writeln('Fizz');
writeln('Buzz');
writeln(56);
writeln('Fizz');
writeln(58);
writeln(59);
writeln('FizzBuzz');
writeln(61);
writeln(62);
writeln('Fizz');
writeln(64);
writeln('Buzz');
writeln('Fizz');
writeln(67);
writeln(68);
writeln('Fizz');
writeln('Buzz');
writeln(71);
writeln('Fizz');
writeln(73);
writeln(74);
writeln('FizzBuzz');
writeln(76);
writeln(77);
writeln('Fizz');
writeln(79);
writeln('Buzz');
writeln('Fizz');
writeln(82);
writeln(83);
writeln('Fizz');
writeln('Buzz');
writeln(86);
writeln('Fizz');
writeln(88);
writeln(89);
writeln('FizzBuzz');
writeln(91);
writeln(92);
writeln('Fizz');
writeln(94);
writeln('Buzz');
writeln('Fizz');
writeln(97);
writeln(98);
writeln('Fizz');
writeln('Buzz');
end.
>>
>>55421108
program fizzbuzzplusplus;
var
i:integer;

begin
writeln('program fizzbuzz;');
writeln('');
writeln('begin');
for i:=1 to 100 do
begin
if (i mod 3=0) and (i mod 5=0) then
writeln(' writeln(''FizzBuzz'');')
else if (i mod 5=0) then
writeln(' writeln(''Buzz'');')
else if (i mod 3=0) then
writeln(' writeln(''Fizz'');')
else
writeln(' writeln(', i, ');');
end;
writeln('end.');
end.
>>
>>55421185

No if statements you cheater
>>
>>55421108
Winrar
>>
>>55420614
Why not go ahead and forbid I/O, touching keyboard, having the screen on etc
>>
>>55420683
>being such a pleb

std::cout << "1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz";
Thread replies: 12
Thread images: 2

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK