if else if ladder

if-else-if ladder ( if() else if() else )

If you have more than one conditions then you can use if-else-if ladder.

If first condition is false then it goes to check next condition. That condition is true which true body area will be execute. After execution if-else-if ladder does not go to check next condition.

If any condition does not match then else{ } will be execute.It means false body area will be execute.

Syntax

if(condition 1){
/* True body area*/
}
else if(condition 2){
/* ture body area*/
}
else if(condition 3){
/* ture body area*/
}
else if(condition 4){
/* ture body area*/
}
-----------
-----------
else{
/*false body area*/
}

See Output

About Us

Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.

Services

Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.


Terms of Use

comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.

Privacy policy

comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.


Sitemap

sitemap

copyright © 2023