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