Raj wants to convert binary number to decimal number system. Binary number system is a base 2 number system. It uses only 2 symbols to represent all its numbers i.e. 0 and 1. Build an algorithm for this conversion.
Answers
Answered by
0
Answer:
hope it's helpful for you
Attachments:
Answered by
1
To convert the binary to decimal numbers the :
1. in the binary numbers the places of 1's are the powers of 2 beginning for the LHS.
and hence, from those values we will sum the entire number and get the decimal value.
Explanation:
1. Start
2.Read the binary number from the user, say ‘n’
3:.Initialize the decimal number, d=0
4. Initialize i=0
5. Repeat while n != 0:
5.1: Extract the last digit by: remainder = n % 10
5.2: n = n/10
5.3: d = d + remainder * 10;
5.4: Increment i by 1
6: Display the decimal number, d
Similar questions
History,
11 hours ago
Geography,
11 hours ago
English,
11 hours ago
CBSE BOARD X,
21 hours ago
Computer Science,
21 hours ago
Math,
8 months ago
Biology,
8 months ago