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