I need a program to convert Binary numbers into Decimal number in Java or in C++.
is there some one who can help me.
Algorithmically (in c/c++):
const char* binary = "110010101011"; int decimal = 0; while ( *binary ) { decimal*=2; decimal+=*binary-'0'; binary++ ; }
Note that this doesn't handle invalid characters (anything other than binary digits).