Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Shift Operators
What will be printed as the result of the operation below:
main() {
int x=5;
printf("%d,%d,%d\n",x,x<<2,x>>2);
}
✍: FYIcenter
As x = 5 = 0x0000,0101; so x << 2 -< 0x0001,0100 = 20; x >> 2 -> 0x0000,0001 = 1. Therefore, the answer is 5, 20, 1.
2007-02-26, 7566👍, 0💬
Popular Posts:
How to measure functional software requirement specification (SRS) documents? Well, we need to defin...
Can two catch blocks be executed? No, once the proper catch section is executed the control goes fin...
If we inherit a class do the private variables also get inherited ? Yes, the variables are inherited...
How Many Tags Are Defined in HTML 4.01? There are 77 tags defined in HTML 4.01: a abbr acronym addre...
What will be printed as the resultof the operation below: int x; int modifyvalue() { return(x+=10); ...