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, 7952👍, 0💬
Popular Posts:
How To Display a Past Time in Days, Hours and Minutes? - MySQL FAQs - Managing Tables and Running Qu...
What Tools to Use to View HTML Documents? The basic tool you need to view HTML documents is any Web ...
How can I enable session tracking for JSP pages if the browser has disabled cookies? We know that se...
Can include files be nested? The answer is yes. Include files can be nested any number of times. As ...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...