Check out example codes for "C++ If". It will help you in understanding the concepts better.

Code Example 1

if (condition) {
  // block of code to be executed if the 
  condition is true
}

Code Example 2

if( a == 10 ) {
      cout << "Value of a is 10" << endl;
   } else if( a == 20 ) {
      // if else if condition is true
      cout << "Value of a is 20" << endl;
   }

Learn ReactJs, React Native from akashmittal.com