3 like 0 dislike
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
[Normal] Coding (C) - asked in Introduction to Computer Programming I (C) by (20.9k points)
ID: 21867 - Available when: Unlimited - Due to: Unlimited
| 37 views
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.158.63.187
©2016-2021

Related questions

3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Feb 6, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21873 - Available when: Unlimited - Due to: Unlimited
| 49 views
6 like 0 dislike
1 answer
[Normal] Coding (C) - asked Oct 16, 2017 in Introduction to Computer Programming I (C) by thopd (12.1k points)
ID: 27170 - Available when: Unlimited - Due to: Unlimited
| 78 views
3 like 0 dislike
0 answers
[Normal] Coding (C) - asked Jan 25, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21795 - Available when: Unlimited - Due to: Unlimited
| 38 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21926 - Available when: Unlimited - Due to: Unlimited
| 71 views
3 like 0 dislike
0 answers
[Normal] Essay (Open question) - asked Feb 12, 2017 in Introduction to Computer Programming I (C) by The Contributor (20.9k points)
ID: 21923 - Available when: Unlimited - Due to: Unlimited
| 60 views
11,539 questions
144,429 answers
149,285 comments
4,159 users