52. WAP to understand masking
#include
<stdio.h>
int
main()
{
printf("WAP
to understand masking\n");
unsigned
int a=0xaabbccdd,n1,n2,n3,n4;
n1
= a & 0xff000000;
printf("%x\n",n1);
n2
= a & 0x00ff0000;
printf("%x\n",n2);
n3
= a & 0x0000ff00;
printf("%x\n",n3);
n4
= a & 0x000000ff;
printf("%x\n",n4);
n1=n1>>24;
n4=n4<<24;
n2=n2>>8;
n3=n3<<8;
a=n1|n2|n3|n4;
printf("%x",a);
}
Comments
Post a Comment