c_operators_test
c_operators_test,
a C code which
demonstrates the use of the built-in operators in C.
In C, operators include the arithmetic operators:
-
+, for addition;
-
-, for subtraction;
-
*, for multiplication;
-
/, for division (real and integer versions);
-
%, for the remainder.
the bit operators:
-
<<, the left shift operator, which multiplies by powers of 2;
-
>>, the right shift operator, which divides by powers of 2;
-
&, the bitwise AND;
-
|, the bitwise OR;
-
^, the bitwise exclusive OR;
-
~, the ones complement;
the logical operators (note that there is no "exclusive OR" operator):
-
!, the logical negation;
-
&&, the logical AND;
-
||, the logical OR.
the increment operators:
-
++, increments by 1;
-
--, decrements by 1;
Licensing:
The computer code and data files described and made available on this
web page are distributed under
the MIT license
Languages:
c_operators_test is available in
a C version.
Related Data and Programs:
c_intrinsics_test,
a C code which
illustrates the use of intrinsic functions supplied by the C language.
Reference:
-
Samuel Harbison, Guy Steele,
C: A Reference Manual,
Third Edition,
Prentice Hall, 1991,
ISBN: 0-13-110933-2,
LC: QA76.73.C15H38.
-
Brian Kernighan, Dennis Ritchie,
The C Programming Language,
Second Edition,
Prentice Hall, 1988,
ISBN: 0-13-110362-8,
LC: QA76.73C15.K47.
Source Code:
Last revised on 16 June 2019.