c language operators are used to perform operations on variables and constants, including arithmetic (such as addition, subtraction, multiplication, division), relations equal greater than), logic and or not), bitwise left shift right). different types of have different priorities. when multiple appear in the same expression, operator with a higher priority is executed first. < p>< blockquote>
< p>
usage c strong><
operators symbols constants. a wide range provided language, operators, relational logical operators.
arithmetic operators<
="=
" code> addition< li>-< subtraction<
*< multiplication< division<
%< find remainder< ul> relational
!="
" not< ;< less than
>< greater
<="
" li>>="
" to<logical operator<
- ##&&
logical and<
- ||
or<
- !
not<
bit operator<
##&
- bits xored
< li>|
- li>^
- bits
< li>~ bits that li><<
- shift left
< code>< li>>>
- right
< ul>operator precedence
< strong>different precedence the following most common order precedence:
< p>brackets ()
- unary (,-,!,~)<
- multiplication, division, remainder="0" (*, , %)<
- addition, subtraction (,-)<
- shift (<<, >>)<
- relational (="=,!=,<,>,<=,>=)
"- logical and(&)< or(|)< ol>operator example
0 && 0); || (false)< pre>
copy after login< div>< p>The above is the detailed content of How to use operators in c language. For more information, please follow other related articles on the PHP Chinese website!
c>
Related labels:source:php.cnPrevious article:Priority order table of operators in c language Next article:What does sizeof mean in c languageStatement of this WebsiteThe content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cnLatest Articles by Author
2024-05-10 05:00:26 2024-05-10 04:57:21 2024-05-10 04:54:17 2024-05-10 04:51:19 2024-05-10 04:45:28 2024-05-10 04:39:16 2024-05-10 04:33:20 2024-05-10 04:30:23 2024-05-10 04:27:19 2024-05-10 04:24:18Latest Issues