"Good Programmer's note sharing" C language if statement use note

Source: Internet
Author: User

iOS training------My C language notes, look forward to communicating with you!

#include <stdio.h>intMain () {/*if (0)//0: false; 1: true {printf ("a\n");      } else {printf ("b\n"); Output B}*/    /*int a = 1044343;    When comparing the size, the constant value is left, the variable is placed to the right//if (a = 0) if (0 = = a) {printf ("a equals 0\n");    } else {printf ("A is not equal to 0\n"); }*/    intA =Ten; //Note the assignment operator, do not write two =A = the; printf ("%d\n", a); /*do not write after the IF statement;        if (5>6);    Error {printf ("a\n"); }*/    if(Ten>6)    {        intA =5;//Scope} printf ("%d\n", a);//Output Display://The following code is wrong: scope ambiguous s    if(Ten>6)        intb =5; //if you want to define a new variable in the statement after the IF, you must use the curly braces {}    return 0;}if

"Good Programmer's note sharing" C language if statement use note

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.