C Programming - Bitwise Operators - Discussion
Discussion Forum : Bitwise Operators - Find Output of Program (Q.No. 11)
11.
What will be the output of the program?
#include<stdio.h>
int main()
{
unsigned int res;
res = (64 >>(2+1-2)) & (~(1<<2));
printf("%d\n", res);
return 0;
}
Discussion:
24 comments Page 2 of 3.
Saikumar said:
1 decade ago
Why is everyone is take only byte information. A number with no decimal point is considered as int so it should 2 byte long.
(1)
Akash said:
1 decade ago
>> means right shift....
It shifts d binary value by n places to right
Ex: 4>>2
0100>>2
1
It shifts d binary value by n places to right
Ex: 4>>2
0100>>2
1
Swati said:
1 decade ago
What is the function of >> operator? Please explain.
Jabya said:
3 years ago
Shifting operations done only on positive numbers.
Dibyendu said:
1 decade ago
Nice vai. Thanks for the explanation.
Gaurav Chaudhary said:
1 decade ago
Thanks for such a nice explanation.
Suresh said:
1 decade ago
Thank you for your explaination.
Ranjitha said:
1 decade ago
What >> operator will do?
Pgk said:
1 decade ago
thank u very much datta
Samyukt said:
1 decade ago
Thanks yaar Datta.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers