#define N 16 main() {int a[N],i,j,x; printf("input x:\n"); scanf("%d",&x); for(i=0;i<N-1;i++) {j=x%2;x=x/2;a[i]=j; if(x==0) break;} for(;i>=0;i--) printf("%d",a[i]); }