fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a=0,n,i,data[32];
  6. scanf("%d",&n);
  7. for(i=n; i>=1; i/=2){
  8. data[a]=n%2;
  9. a=a+1;
  10. n=n/2;}
  11. for(i=a-1; i>=0; i--)
  12. printf("%d",data[i]);
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5328KB
stdin
32
stdout
100000