#include<stdio.h> void main() { int a[16] = {0},c; int m = 10; int i = 0,j = 0; //scanf("%d",&m); while(m>0) { a[i++] = m%2; m/=2; } for(j = i-1;j>=0;j--) printf("%d ",a[j]); }