-
Do you want to be an array of binary numbers? Or a decimal value?
Binary array methods:
#include
#define max_bits 64
int main()
char c="101101010011";
int bin[max_bits];
int i, n;
for(i = 0; c[i]!='\0'; i++)bin[i] = c[i] -'0';
n = i;
for(i = 0; i < n; i ++printf("%d", bin[i]);
printf("");
return 0;
-
Binary is changed to decimal, multiplied by 2 0, 2 1, 2 2 from right to left, etc, and finally the results of multiplication are added to give the decimal result.
-
(1111)b
1 2 to the 3rd power + 1 2 to the 2nd power + 1 2 to the 1st power = 1 2 to the 0th power.
-
That is, the closed person of the two-entry sedan car rush is converted 101101 decimal system.
for 45If you don't understand, you can**.
-
For decimal places, start with the first digit to the right of the decimal point and write it down as -1, -2, -3 once, like this one.
1-1-2-3, the base is 1*2 -1+0*2 -2+1*2 -3=
-
The decimal number 0 to 30 is converted to a binary number in order of 0, 1,10,11,100,101,110,111,1000,1001,1010,1011,1100,1101,1110,1111,10000,10001,10010,10011,10100,10101,10110,10111,11000,11001,11010,11011,11100,11101,11110
Replace the decimal number with a binary number, and divide it by 2 to take the remainder....
-
The conversion of binary numbers 011111 to decimal integers is ( ) Correct answer: d
Answer analysis: The number system, also known as the counting system, refers to the method of using the same set of fixed characters and unified rules to represent numerical values. The decimal system (in natural language) is usually represented by 0 to 9, binary (in computers) is represented by 0 and 1, octal is represented by 0 to 7, and hexadecimal is represented by 0 to f.
1) Convert decimal integers into binary (octal, hexadecimal), conversion method: divide the decimal remainder by the two (eight, sixteen) decimal number, the remainder obtained for the first time is the least significant bit, and the remainder obtained for the last time is the most significant bit. (2) Convert two (eight, sixteen) decimal integers to decimal integers, conversion method:
Weight the base number of two (eight, sixteen) and find the sum to get the corresponding decimal number. (3) Conversion between binary and octal or hexadecimal numbersConversion method between binary and octal: 3-bit binary can be converted to 1-digit octal, and 1-digit octal number can be converted to 3-digit binary number.
Conversion method between binary number and hexadecimal: 4-bit binary can be converted to 1-digit hexadecimal number, and 1-digit hexadecimal number can be converted to 4-bit binary number. Therefore:
011111)b=1*2^4+1*2^3+1*2^2+1*2^1+1*2^0=31(d)。
-
Converted to a decimal integer is 31. The conversion of binary numbers 011111 to decimal integers is 31.
Composition of a computer A computer is made up of two parts: hardware and software. Hardware On the outside, a computer is made up of a host, a monitor, a keyboard, a mouse, and a speaker. In terms of function, the hardware of the computer mainly includes the processor, memory, input device, output device, etc. >>>More
1) Because the hundred can only be selected in the inside, after the selection of the hundred, there are 4 choices for the single digit, and there are only 3 choices for the ten digits, if the single digit is 1, then the three-digit number has 4*3=12, and in the same way, the three-digit number of the single digit also has 12 respectively. >>>More
Read in a minute. Principles of Computer Composition.
Odd numbers 285, 205, 825, 805
Even numbers 502, 582, 508, 528, 258, 208, 802, 852, 250, 280, 520, 580, 820, 850 >>>More
A hundred-legged insect, a blind man touching an elephant, and the branch is greater than the original.