One or two binary number converted to decimal number
The basic practice of converting a binary number to a decimal number is to first write the binary number as the weighted coefficient expansion, and then sum it by the decimal addition rule. This practice is known as the "weighted addition" method.
Function to convert binary to decimalint binary_decimal (int num) {int dec = 0, base = 1, REM; while (num > 0) {rem = num% 10; Dec = Dec + rem*base; base = base*2; Num/= 10; } return Dec;
Second, decimal number converted to binary number
Function to convert decimal to binaryint decimal_binary (int num) {int REM, base = 1, binary = 0; while (num! = 0) {rem = num% 2; Num/= 2; binary + = Rem*i; Base *= 10; } return binary;}
Three or two conversion between binary number and octal number
Four or two binary and 16 binary conversions
Conversion between binary, octal, decimal, hexadecimal numbers