C++ Syntax Conditional Statements if...else

 

- Info:

- This tutorial shows how to use "if" conditional statements.

 

- Example:

- Create C++ Console Application Test.cpp.

 

Test.cpp

#include <stdio.h>

int main() {

int i = 11;

if (i==10) { printf("i is 10" ); }

else if (i==11) { printf("i is 11" ); }

else { printf("No match found"); }

return 1;

}