Answer:
See explaination
Step-by-step explanation:
void bin2dec(char *s) {
int i = 0, num = 0;
while (s[i]) {
num *= 2;
num += s[i] - '0';
i++;
}
printf("%d\\", num);
}
The program Implement function bin2dec that takes a binary number bin_num as a string argument and prints out the corresponding decimal number.