int main( void )
{
unsigned char a = 40, b=20;
a = ( a>>4 ) | ( a<<4 );
b = ( ( b & 0xAA ) >> 1 ) | ( ( b & 0x55 ) << 1 );
printf( "After Nibble Swap %d\n", a );
printf( "Alternate Bit swapping %d\n", b );
getch();
return 0;
}
No comments:
Post a Comment