You are given a number A in binary format (Base = 2). You have to print the number in decimal format (Base = 10). code example
Example: convert binary to decimal c++ stl
string bin_string = "10101010";
int number =0;
number = stoi(bin_string, 0, 2);
// number = 170