C # Operators

Source: Internet
Author: User

Operator

1. Arithmetic operators

assignment operator  

c#

An expression that is connected by an equal sign, called an assignment expression. We require that the data types on both sides of the equal sign must be one .

2. Arithmetic operators

)

)

++

, whether it's pre-Gaga or post-Gaga.

to itself

- -

, whether it's a pre-or post-decrement.

      

        

3. use of the plus sign

1. connection, when the plus sign on either side is a string, at this time, the function of the plus is to connect

2. Add, when the plus sign is on both sides of the number, the plus sign is the function of adding.

4. Compound assignment operator

+=     -=      *=       /=     %=     

Example number = number-10;

Number = ten;

5. Relational operators

An expression that is connected by a relational operator is called a relational expression.

>   ,  , >= ,   <= ,   Span style= "Font-family:times New Roman;" >== !=

Each expression is able to solve a fixed value.

6. Logical Operators

Logic and &&

logical OR     

logical non-    

Note:   bool The value of type

logic and precedence are higher than logical OR.

C # Operators

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.