Program to Nibble and bit swapping
int main( void ){
unsigned char a = 40, b=20;
a = ( a>>4 ) | ( a<<4 );
b = ( ( b & 0xAA ) >> 1 ) | ( ( b & 0x55 ) << 1 );
clrscr();
printf( āAfter Nibble Swap %d\nā, a );
printf( āBit swapping %d\nā, b );
getch();
return 0;
}
Comments