I converted a decimal integer to binary and that binary integer when I'm trying to convert to a string is giving me 1 as the answer always when it should give the value of the string.
while(a>0)
{
b = a%2;
n = b;
a = a/2;
System.out.print(n);
}
String m = Integer.toString(n);
System.out.print(m);
Any corrections and suggestions would be much appreciated.
Thanks!