fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int points;
  6. cout << "Enter the points the student received (0-100):";
  7. cin >> points;
  8.  
  9. cout << "\n Grade: ";
  10.  
  11. if (points >= 0 && points <= 50) {
  12. cout << "ndst\n";
  13. }
  14. else if (points >= 51 && points <= 60) {
  15. cout << "dop\n";
  16. }
  17. else if (points >= 61 && points <= 70) {
  18. cout << "dst\n";
  19. }
  20. else if (points >= 71 && points <= 80) {
  21. cout << "db\n";
  22. }
  23. else if (points >= 81 && points <= 90) {
  24. cout << "bdb\n";
  25. }
  26. else if (points >= 91 && points <= 100) {
  27. cout << "cel\n";
  28. }
  29. else {
  30. cout << "Invalid points! Enter a value between 0 and 100.\n";
  31. }
  32. return 0;
  33. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Enter the points the student received (0-100):
 Grade: Invalid points! Enter a value between 0 and 100.