Prelude, 6 bytes
Prelude is a bit tricky here. The language specification says I/O is via characters' byte values. That's what the C implementation does. Then there's the Python interpreter, which uses bytes for input but prints decimal integers. And then there's my own fork of that interpretermy own fork of that interpreter which does both input and output numerically (which I've published a few months ago). Since languages on PPCG are defined by their implementations, all of these constitute valid Prelude variants.
My fork gives the shortest solution at 6 bytes:
?(1!)! ? pushes the input. (...) is a Brainfuck-style while loop, which is skipped for 0 input. Then ! prints the zero. If the input was 1, we enter the loop, push another 1 and print that with ! (we need to push a new 1, because ! pops the top of the stack).
Next up is the original Python interpreter at 14 bytes:
?6^+^+^+-(1!)! Since output is the same as in my fork, all we need to do is map the character codes to 0 or 1 which we do by subtracting 48. There are several ways to get 48 in 7 bytes, but I don't think it's possible to do it in less. This one pushes 6 and then doubles it 3 times, by duplicating it with ^ and adding the two copies with +.
Finally, the solution that works with the original C interpreter needs 16 bytes:
?^(#^!^6^+^+^+-) This one has a slightly different structure. Since we also need to output 48 or 49 respectively, we now remember the input and obtain the 0 or 1 only for the loop condition. This also let's us get a way with a single ! because we can easily turn the loop into do-while. Again, ? reads the input and ^ makes a copy which we only need because the first thing in the loop is #, which discards the top of the stack (we need this to discard the condition from a previous iteration). Now ^! prints a copy of the input. Then ^6^+^+^+- computes input - 48 as before. If that is 0, we leave the loop immediately and exit after printing a single number. Otherwise, the loop will keep going, printing the input 49 each time.