Stage C [02] and [02]

Source: Internet
Author: User

Stage C [02] and [02]

Knowledge focus:

  • Boolean Type
  • Relational operators
  • Logical operators
  • If statement
  • Enumeration type
  • Switch statement

 

1. boolean BOOL type

It is used to store "true" or "false", and only YES and NO values are changed. YES (1) indicates that the expression result is true, and NO (0) indicates that the expression result is false.

If the value is not 0, it is true.

 

Ii. Relational operators

It is mainly used for comparison operations. The comparison result is only true or false, and the result value is stored with the BOOL type.

Greater than:>; greater than or equal to: >=; less than: <; less than or equal to: <=; equal to: =; not equal :! =.

 

Iii. logical operators

Logic and (&)-And: True, false;

Logic or (|) --- or: same false, true or false;

Non-logical (! )-On the contrary, false indicates true or false;

 

IV. if statement

The if statement can be used to construct a branch structure. It is determined based on the given conditions, and the explain statement decides to execute the program segment of a branch.

Supplement: Conditional operator-three-object Operator

 

Related Article

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.