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 : Negation Operator
<11.03>
/* The negation bitwise operator */ #include <stdio.h> int main (void) { int a = 10, b = 25, c = 64, d = 100; int e = -10, f = -25, g = -64, h = -100; printf (" a = %5d (%08X HEX) \n~a = %5d (%08X HEX)\n", a, a, ~a, ~a); printf (" b = %5d (%08X HEX) \n~b = %5d (%08X HEX)\n", b, b, ~b, ~b); printf (" c = %5d (%08X HEX) \n~c = %5d (%08X HEX)\n", c, c, ~c, ~c); printf (" d = %5d (%08X HEX) \n~d = %5d (%08X HEX)\n", d, d, ~d, ~d); printf (" e = %5d (%08X HEX) \n~e = %5d (%08X HEX)\n", e, e, ~e, ~e); printf (" f = %5d (%08X HEX) \n~f = %5d (%08X HEX)\n", f, f, ~f, ~f); printf (" g = %5d (%08X HEX) \n~g = %5d (%08X HEX)\n", g, g, ~g, ~g); printf (" h = %5d (%08X HEX) \n~h = %5d (%08X HEX)\n", h, h, ~h, ~h); return(0); }
Hergestellt in Deutschland / Made in Germany
a = 10 (0000000A HEX) ~a = -11 (FFFFFFF5 HEX) b = 25 (00000019 HEX) ~b = -26 (FFFFFFE6 HEX) c = 64 (00000040 HEX) ~c = -65 (FFFFFFBF HEX) d = 100 (00000064 HEX) ~d = -101 (FFFFFF9B HEX) e = -10 (FFFFFFF6 HEX) ~e = 9 (00000009 HEX) f = -25 (FFFFFFE7 HEX) ~f = 24 (00000018 HEX) g = -64 (FFFFFFC0 HEX) ~g = 63 (0000003F HEX) h = -100 (FFFFFF9C HEX) ~h = 99 (00000063 HEX)
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland