fork download
  1. #include <stdio.h>
  2.  
  3. long binario(int num) {
  4. if (num == 0) return 0;
  5. return (num % 2) + 10 * binario(num / 2);
  6. }
  7.  
  8. int main() {
  9. printf("%ld", binario(1025));
  10. }
  11.  
  12. //https://pt.stackoverflow.com/q/184447/101
Success #stdin #stdout 0s 4396KB
stdin
Standard input is empty
stdout
10000000001