Search This Blog

Sunday, October 5, 2014

WAP to swap two nibbles in a given number

1:  main()  
2:  {  
3:    unsigned int num = 0xfc;  
4:    num = (num>>4 & 0x0f) | (num<<4 & 0xf0);  
5:    printf("Result = 0x%x\n",num);  
6:  }   

No comments:

Post a Comment