Question: 1 THE BINARY TO DECIMAL PROBLEM Write a function named binToDec() that accepts an integer parameter whose digits are meant to represent binary (base-2) digits,
1 THE BINARY TO DECIMAL PROBLEM Write a function named binToDec() that accepts an integer parameter whose digits are meant to represent binary (base-2) digits, and converts that integer's representation to decimal (base 10). The function should return the integer value before it was converted. For example, givern this code int a 101011; int b = binToDec (a); cout 43, b->101011 Constraints: Do not use a string in your solution. Also do not use any built-in base conversion functions from the system libraries. You must program this by "hand
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
