-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQ28.c
More file actions
25 lines (22 loc) · 640 Bytes
/
Q28.c
File metadata and controls
25 lines (22 loc) · 640 Bytes
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
/* Program: 28
Write a c program to understand all the bitwise operators available in c.
*/
#include <stdio.h>
int main()
{
unsigned int a = 60;
unsigned int b = 13;
int c = 0;
c = a & b;
printf("c=a&b; Value of c is %d\n", c);
c = a | b;
printf("c=a|b; Value of c is %d\n", c);
c = a ^ b;
printf("c=a^b; Value of c is %d\n", c);
c = ~a;
printf("c= ~a; Value of c is %d\n", c);
c = a << 2;
printf("c=a<<2; Value of c is %d\n", c);
c = a >> 2;
printf("c=a>>2; Value of c is %d\n", c);
}