(Binary to decimal) Rewrite the bin2Dec function in Programming Exercise to convert a binary string to a decimal number with the following header:
int bin2Dec(const char binaryString[])
Write a test program that prompts the user to enter a binary number as a string and displays its decimal equivalent value.
Programming Exercise (Binary to decimal) Write a function that returns a decimal number from a binary string. The function header is as follows:
int bin2Dec(const string & binaryString)For example, binaryString 10001 is 17 (1 × 24 + 0 × 23 + 0 × 22 + 0 × 2 + 1 = 17). So, bin2Dec("10001") returns 17. Write a test program that prompts the user to enter a binary number as a string and displays its decimal equivalent value.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.