IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CBitwise Operators & Binary Files : Left Shift Operator
<11.01>
/* The left shift bitwise operator */ #include <stdio.h> int main (void) { unsigned a=64, b=25, c=1, d=100; printf ("%4d << 1 = %4d (%04x HEX)\n", a, a<<1, a<<1); printf ("%4d << 1 = %4d (%04x HEX)\n", b, b<<1, b<<1); printf ("%4d << 1 = %4d (%04x HEX)\n", c, c<<1, c<<1); printf ("%4d << 1 = %4d (%04x HEX)\n", d, d<<1, d<<1); printf ("%4d << 2 = %4d (%04x HEX)\n", a, a<<2, a<<2); printf ("%4d << 3 = %4d (%04x HEX)\n", b, b<<3, b<<3); printf ("%4d << 4 = %4d (%04x HEX)\n", d, d<<4, d<<4); printf ("%4d << 5 = %4d (%04x HEX)\n", d, d<<5, d<<5); return(0); }
Hergestellt in Deutschland / Made in Germany
64 << 1 = 128 ( 80 HEX) 25 << 1 = 50 ( 32 HEX) 1 << 1 = 2 ( 2 HEX) 100 << 1 = 200 ( c8 HEX) 64 << 2 = 256 (100 HEX) 25 << 3 = 200 ( c8 HEX) 100 << 4 = 1600 (640 HEX) 100 << 5 = 3200 (c80 HEX)
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland