Nested if else statement
Nested if else statements are used to execute different piece of code when we have more than two options to handle.
Grade selection based on score.
Here, if our score is more than 90, we will get S grade
If our score is in between 80 and 90, we will get A grade
If our score is in between 70 and 80, we will get B grade
If our score is in between 60 and 70, we will get C grade
If our score is in between 51 and 60, we will get D grade
If our score is 50, we will get E grade
Below 50 will be declared as U.
Here, we have more than 2 options to handle.
It will check each condition sequentially and once the condition succeeds it goes to the corresponding block.
If none of them are true, then else code part will take place.
Get score from the user and display the grade based on above logic.