fork(42) download
  1. #include <stdio.h>
  2.  
  3. void print_binary(unsigned int number)
  4. {
  5. if (number >> 1) {
  6. print_binary(number >> 1);
  7. }
  8. putc((number & 1) ? '1' : '0', stdout);
  9. }
  10.  
  11. int main(void) {
  12. print_binary(42);
  13. printf("\n");
  14. print_binary(0);
  15. printf("\n");
  16. print_binary(-12);
  17. printf("\n");
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
101010
0
11111111111111111111111111110100