#include
#include
#include
using namespace std;
int main( )
{
// Read a binary number into a bitset
cout << "Enter a binary number: ";
bitset< numeric_limits::digits > bits;
cin >> bits;
unsigned long decimal_equivalent = bits.to_ulong();
cout << "Binary number: " << bits << "\nDecimal equivalent: " << decimal_equivalent;
}