文件名称:c语言或者c++ :Bit manipulations 位操作
文件大小:867B
文件格式:C
更新时间:2016-12-30 02:59:02
unsigned long integer
Define an unsigned long integer and initialise it to the binary pattern: 0101 1111 0001 1000 1001 0010 1101 0011 Using hexadecimal notation print the hex value on the console. Write a function to print a long integer on the console in hex and binary form. Now perform the following operations on the pattern and print out the results of each operation in hex and binary format. Right shift the binary pattern by 4 bits. Left shift the pattern by 6 bits. AND the value with the long int 0x3 AND the value with the char 0x3 OR the value with the unsigned short 0xf00f Exclusive OR the value with the long int 0xF0F0F0F0