Logic operations C && logic and etc.

Source: Internet
Author: User

Logical Operation:
    1. Can judge whether two or more conditions are established, from three kinds;
    2. Logic, logic, logic, or the result is 1 and 0; true and false;
    3. && Logic and condition a&& condition B; only A and b result is 1 when it is 1;
    4. || logical OR; When a or b is established, the result is 1; none is established, 0;
    5. Any value has a true or false nature;
    6. The operation process; If the left is set up, it depends on the right side; This is for logic and; If the left is not true, the right side is not seen;
    7. int a = 10;int b = 10;int c = (a<5) && (++b>=11), the result of B is 10, because the latter is not executed;
    8. Logical OR; | | ; int a = 0 | | 10; the result is 1; If the left is set, the right side is not seen;
Logical Non:
    1. conditions require only one;! Add a condition after the exclamation point; take the counter action;
    2. Returns 0 if the condition is true, and returns 1 if the condition is not true;
    3. int a =!-19; 0; logical non-precedence is higher than >;
    4. int a =!! 10, can be used continuously multiple!, the result is 1;

Logic operations C && logic and etc.

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.