To input a student's numeric score and print a letter grade


SUBMITTED BY: Guest

DATE: Oct. 12, 2013, 2:07 a.m.

FORMAT: C++

SIZE: 579 Bytes

HITS: 1422

  1. #include <stdio.h>
  2. int main()
  3. {
  4. int score;
  5. printf("\n Please enter a numeric score : ");
  6. scanf_s("%d", &score);
  7. if (score >= 90)
  8. {
  9. printf("\n Your grade is an A.");
  10. }
  11. else if (score >= 80)
  12. {
  13. printf("\n Your grade is a B.");
  14. }
  15. else if (score >= 70)
  16. {
  17. printf("\n Your grade is a C.");
  18. }
  19. else if (score >= 60)
  20. {
  21. printf("\n Your grade is a D.");
  22. }
  23. else
  24. {
  25. printf("\n Your grade is an F.");
  26. }
  27. getchar();
  28. getchar();
  29. return 0;
  30. }

comments powered by Disqus