0
What is the program if output show this ? Pls help ayone
Enter a mark: 78 Enter a mark: 56 Enter a mark: 105 Invalid score. Enter a mark: 88 Enter a mark: -5 Invalid score. Enter a mark: 50 Enter a mark: 63 The number of marks below 50.0 is 0 The highest mark entered is 88 The lowest mark entered is 50
2 Answers
+ 3
Izzat Idham
Where is your attempts?
+ 3
You can use multiple or nested "if" - "else if" - "else" statements. For example:
int x = 5;
if (x > 5) {
....
cout << "larger" << endl;
}
else if (x < 5){
....
cout << "smaller" << endl;
}
else {
....
cout << "equal" << endl;
}
- - - - - - - - -
Logical operators may also help you with that program, such as &&. For example:
if (x > 5 && x < 10) {
cout << "in between 5 and 10" << endl;
}
Please show your attempt first next time. Or if you already have your attempt, please share with us so we may help. Thanks!