Kodingan Bahasa C Manipulasi bit

#include<stdio.h>
#include<conio.h>

void main( ){
int x=6, y=10;

printf("%d, ", x & y); //output 2   and
printf("%d, ", x | y); //output 14   or
printf("%d, ", x ^ y); //output 12  xor
printf("%d, ", x << y); //output 6144  shift left
printf("%d, ", x >> y); //output 0 shift right
printf("%d, ", ~x); //output -7

getch ( );
return 0;
}
Comments
0 Comments

No comments: