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