How to use operators in c language

下次还敢
Release: 2024-04-29 19:39:18
Original
858 people have browsed it

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>

How to use operators in c language< 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 ()

      1. unary (,-,!,~)<
      2. multiplication, division, remainder="0" (*, , %)<
      3. addition, subtraction (,-)<
      4. shift (<<, >>)<
      5. relational (="=,!=,<,>,<=,>=)
      6. "
      7. 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.cn
Statement of this Website
The 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.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!