Conditional statements are used to perform different actions based on different conditions. Dart supports various types of conditional statements including if, else, else if, and the ternary operator.
void main() {
int score = 85;
// if statement
if (score > 90) {
print('Excellent');
}
// else if statement
else if (score > 75) {
print('Good');
}
// else statement
else {
print('Needs Improvement');
}
}