IHYPRESS.NET
C
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Earn Free Bitcoin
CData Types & Operators ❯ Negation Unary Arithmetic Operator
<02.05>
/* The (-)unary operator */
#include <stdio.h> int main (void) { int a, b, c; a = 10; b = 20; /* b is 20 so -b is -20 */ b = -b + a; /* with multiple similar unary operators, use parentheses */ /* do you understand why c is 30? */ c = -b - (-a) + -b; printf ("The value of b is %d ", b); printf ("and the value of c is %d\n", c); return (0); }
Hergestellt in Deutschland / Made in Germany
The value of b is -10 and the value of c is 30
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.