fork download
  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include <stdio.h>
  4. #include <time.h>
  5. #include <stdlib.h>
  6. #include <assert.h>
  7. #include <limits.h>
  8.  
  9.  
  10. void print_binary(uint8_t number);
  11.  
  12. void print_binary(uint8_t number)
  13. {
  14. if (number >> 1) {
  15. print_binary(number >> 1);
  16. }
  17. putc((number & 1) ? '1' : '0', stdout);
  18. }
  19.  
  20. int main(void) {
  21. print_binary(42);
  22. printf("\n");
  23. print_binary(0);
  24. printf("\n");
  25. print_binary(-12);
  26. printf("\n");
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
101010
0
11110100