Question: If you can please try to write it without #include 2. Input an integer containing only 0 s and 1 s (i.e. binary integer) and
If you can please try to write it without #include
2. Input an integer containing only 0 s and 1 s (i.e. binary integer) and prints its decimal equivalent. Use the modulus and division operators to pick off the binary digits as before. You only need to handle a fixed-length, 5-digit binary integer for this question. Assume that the user will always enter a 5 -digit integer. Sample Output: Enter a binary number : 11011 Decimal equivalent of 11011 is 27
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
