C++ if statement with else if statement

Introduction

The else if Statement

#include <iostream> 
  
using namespace std; 
  
int main(int argc, const char * argv[]) 
{ 
        if (false) 
        { // w w w .j av a  2s  .  c om
                cout << "Print This When True!"; 
        } 
        else if (true) 
        { 
                cout << "Print This When Else If Is True!"; 
        } 
        else 
        { 
                cout << "Print This If All False!"; 
        } 
      
        return 0; 
}



PreviousNext

Related