Write a program that reads 8 bits (each bit is 0 or 1) and displays the corresponding decimal number, assuming that the bits are entered from left to right (The first digit is MSB: Most Significant Binary). For example, if the user enters 10000000 the program should display 128.
Sample Input:
101
Sample Output:
5
References: C From Theory