-
Notifications
You must be signed in to change notification settings - Fork 0
/
BitWiseOperators.c
72 lines (61 loc) · 1.09 KB
/
BitWiseOperators.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Name Ankesh Sharma
// Date 03-01-2024
// Language C
#include <stdio.h>
#include <conio.h>
// int binarydigit();
// int bitwiseand();
// int bitwiseor();
// int bitwisexor();
// int bitwiseleftshift();
int bitwiserightshift();
int main()
{
// binarydigit();
// bitwiseand();
// bitwiseor();
// bitwisexor();
// bitwiseleftshift();
bitwiserightshift();
printf("HERE WE GO BROOOOOOO!!!!!!!!!");
}
int binarydigit()
{
int a = 10000;
int ch = 23;
int dh;
dh = ~ch;
printf("~ch = %d\n", dh);
printf("~ch = %d\n", dh);
printf("~ch = %d\n", dh);
return 0;
}
int bitwiseand(){
int a = 10;
int b = 6;
int c= 8;
printf("%d",a&b&c);
}
int bitwiseor(){
int a = 10;
int b = 6;
printf("%d",a|b);
}
int bitwisexor(){
int a = 10;
int b = 6;
int c= 8;
printf("%d",a^b^c);
}
int bitwiseleftshift(){
int a = 16;
int shift_integer = 4;
int d = a<<shift_integer;
printf("%d",d);
}
int bitwiserightshift(){
int a = -12;
int shift_integer = 4;
int d = a<<shift_integer;
printf("%d%d",d,a);
}