Skip to main content

Program to Nibble and bit swapping

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

Popular posts from this blog

CAN INTERVIEW QUESTIONS

Qualifiers and Modifier in C

RTOS Real time operating system interview questions

CAN INTERVIEW QUESTIONS 2

What is UDS protocol

Memory mapping in c

TOP IOT PLATFORMS