Tag Archives: #nowinhd

Mastery18

 

Here is the youtube link to mastery 18: https://www.youtube.com/watch?v=CeLnp1FGiB4

So basically nested conditional statements allow us to create an if-else statement that validates more than two options for one variable, here is an example:

<iostream>

 

using namespace std;

int main(){

int a;

cout<<“give me a: “<<endl;

cin>>a;

if (a<0){

  cout<<“less”<<endl;

}else {

  if(a==0){

    cout<<“equals “;

  }else{

    cout<<“greater “;

  }

}

return 0;

}