• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Study Abroad
  • Writing Services
  • About Us
  • Contact
  • Blog

AcademicsHQ

Instant access to Study Resources, 24/7 Homework Help, Tutors, to help you ace your homework.

homework help
  • Academic Writing
    • Dissertation Writing
    • Report Writing
  • Research Process
  • Referencing Guide
  • Resume Writing
Home » Blog » If else ladder (conditional statements) in Programming

If else ladder (conditional statements) in Programming

June 15, 2019 by academicshq Leave a Comment

The if-else ladder is used when there are multiple conditional statements that may all evaluate to true, yet you may want only one if statement’s body to execute. You can use an “else-if” statement following an if statement and its body.

That way, if the first statement is true, the “else if” will be ignored, but if the if statement is false, it will then check the condition for the else if statement. if the if statement was true the else statement will not be checked. It is possible to use numerous else if statements to ensure that only one block of code is executed.


GET INSTANT HELP FROM EXPERTS!

  • Looking for any kind of help on your academic work (essay, assignment, project)?
  • Want us to review, proofread or tidy up your work?
  • Want a helping hand so that you can focus on the more important tasks?

Hire us as project guide/assistant. Contact us for more information


Syntax for If else ladder:

If (condition)
{
statements;
}
else if (condition)
{
statements;
}
else if (condition)
{
statements;
}
.
.
.
.
else
{
statements;
}

For example, you can take the grades of various students and assign them various grades using the If else ladder.

Let’s say:

Grade A+ means percentage over 75
Grade A means 75 > percentage >= 60
Grade B means 60 > percentage >= 50
Grade C means 50 > percentage >= 40
Fail means 40 > percentage

Percentage of each student can be calculated using the formula (total obtained marks/total maximum marks) * 100

Once the percentage is obtained, the grade of the student can be determined (by referring to the table above) using the If else ladder.

If percentage is greater than 75 display grade as A+
else if percentage is less than 75 and greater than or equal to 60 then display grade as A
else if percentage is less than 60 and greater than or equal to 50 then display grade as B
else if percentage is less than 50 and greater than or equal to 40 then display grade as C
else display result as Fail.

Filed Under: Computers

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *


Primary Sidebar

Recent Posts

  • Hindi Project Work: Hindi Pariyojana Karya (हिंदी परियोजना कार्य)
  • Geography Projects Class 10
  • Money Education for Kids: Teach Them Financial Responsibility
  • Bachelor of Management Studies (BMS): Project Work
  • BMS (Bachelor of Management Studies): Assignment & Project Topics

Categories

  • Black Book Projects
  • Book Reviews
  • Business Law
  • CBSE Study Notes
  • Computers
  • Digital Business
  • Economics
  • Education Articles
  • English Literature
  • Environmental
  • Essays
  • Foreign Education
  • General
  • Geography
  • German
  • Global Education
  • Hindi
  • History
  • Hotel Management
  • HRM
  • Jobs
  • Management
  • Management Notes
  • Math
  • Media Study Notes
  • Movie Reviews
  • Primary
  • Research
  • Sample Essays
  • School Projects
  • School Study Notes
  • Science
  • Self Improvement
  • Services
  • Social Studies
  • Sociology
  • Solved Assignments
  • Student Software
  • Uncategorized
  • Writing Tips

Footer

CLASS NOTES

  • Class 10 . Class 9
  • Class 8 . Class 7
  • Class 6 . Class 5
  • Class 4 . Class 2
  • Class 2 . Class 1

ACADEMIC HELP

  • Essay Writing
  • Assignment Writing
  • Dissertation Writing
  • Thesis Writing
  • Capstone Projects
  • Homework Help
  • Report Writing

SERVICES

  • Writing Services
  • Book Review
  • Ghost Writing
  • Make Resume/CV

ABOUT US

  • About Us
  • Contact
  • Privacy Policy
  • Blog

Copyright © 2025 · News Pro on Genesis Framework · WordPress · Log in