This commit is contained in:
Akbar Rahman 2023-10-06 13:21:32 +01:00
parent 0fe9a5ef19
commit 397409d0ad
Signed by: alvierahman90
GPG Key ID: 20609519444A1269
2 changed files with 28 additions and 0 deletions

14
C6/ex2.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
int main() {
unsigned int a = 60;
unsigned int b = 13;
unsigned int r;
r = a & b;
printf("bitwise AND of 60 and 13: %d\n", r);
r = a | b;
printf("bitwise OR of 60 and 13: %d\n", r);
r = a ^ b;
printf("bitwise XOR of 60 and 13: %d\n", r);
}

14
C6/ex3.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
int main() {
unsigned int a = 0x60;
unsigned int b = 0x13;
unsigned int r;
r = a & b;
printf("bitwise AND of 0x60 and 0x13: 0x%02x\n", r);
r = a | b;
printf("bitwise OR of 0x60 and 0x13: 0x%02x\n", r);
r = a ^ b;
printf("bitwise XOR of 0x60 and 0x13: 0x%02x\n", r);
}