Topic 9: JS if, else if & else

//Regular Lecture 14: 10 Oct 2022

//Topic 9: //* if, else if & else *//


//A) if

//example 1

if(1<2){
    console.log("Hello")
}

//example 2

if(2<1){
    console.log("Hi")
}

console.log("----------")



//B) if, else

//example 1

if(5==5){
    console.log("Right")
}
else{
    console.log("Wrong")
}

//example 2

if(5!=5){
    console.log("Right")
}
else{
    console.log("Wrong")
}

console.log("-----------")



//C) if, else if, else

//example 1

if(6==6){
    console.log("ram")
}
else if(5>4){
    console.log("sham")
}
else{
    console.log("laxman")
}

//example 2

if(6!=6){
    console.log("ram")
}
else if(5>4){
    console.log("sham")
}
else{
    console.log("laxman")
}

//example 3

if(6!=6){
    console.log("ram")
}
else if(5<4){
    console.log("sham")
}
else{
    console.log("laxman")
}


//example 4

if(6!=6){
    console.log("ram")
}
else if(5<4){
    console.log("sham")
}
else if(10>9){
    console.log("suhas")
}
else{
    console.log("laxman")
}

टिप्पण्या