else if c++

C++

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


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

  
  if (condition1) {
  // block of code to be executed if 
  condition1 is true
} else if (condition2) {
  // block of 
  code to be executed if the condition1 is false and condition2 is true

  } else {
  // block of code to be executed if the condition1 is false 
  and condition2 is false
}

     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;
   } 
Source

Also in C++: