CSE 202: Computer Science II, Winter 2018
Lab 9

Use std::bitset to implement the following programs:

1. Create a program named bindec; for each binary string that this program extracts from standard input, it's equivalent decimal integer value should be inserted to standard output.

Solution

2. Create a program named decbin; for each decimal integer that this program extracts from standard input, it's equivalent binary string value should be inserted to standard output with the leading zeros removed.

Solution