Head A C # Chinese version chapter II page68

Source: Internet
Author: User

Set the condition and see if it is true to tell your program with the If/else statement when the condition is true (or false) to do something specific. Check conditions with logical operators you've seen the = = operator, and you use it to check whether two variables are equal. There are a lot of other operators. You don't have to be in a hurry to remember them--you'll see them over and over again in the next few chapters. *! The = operator is similar to = =, except that it is true when the two variables you compare are not equal. * You can use < or > to compare numbers to see which size is smaller. *==,! =,<,> is called the conditional operator. When you use them to test two variables or values, this is called performing a conditional test. * You can use && representative and,| | Represents or to combine two conditional tests into one test. So check if I equals 3 or if J is less than 5, so write: (i==3) | | (j<5). Using the conditional test operator to compare two numbers is called a conditional test. Set a variable and check its value

Here is the code for the second button. This is an instruction to check whether an integer variable called x is equal to 10.

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.