fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. unsigned x;
  6. int i=0;
  7. int a[32]={0};
  8. printf("Podaj liczbe: ");
  9. scanf("%u",&x);
  10. do { a[i++]=x%2; x/=2; } while(x>0);
  11. while(i) printf("%d",a[--i]);
  12. printf("\n");
  13. return 0;
  14. }
Success #stdin #stdout 0s 1836KB
stdin
423
stdout
Podaj liczbe: 110100111