int bin(int a) { int b = 0; while(a!=0) { b = b*10; if(a%2 == 1) { b = b+1; } a = a/2; } return b; }