Saket Singh

Saket Singh

  • NA
  • 82
  • 5.6k

Changing Number to Letter Grades

Oct 23 2022 5:14 PM
#include #include char findLetter(int grade); int main() { int score; //taken as user input int grade; printf("\tEnter your numberical grade: "); scanf("%i", score); findLetter(grade); printf("Your grade is a %i", grade); return 0; } char findLetter(int grade) { switch(grade/10) { case 10: { return 'A'; break; } case 9: { return 'A'; break; } case 8: { return 'B'; break; } case 7: { return 'C'; break; } case 6: { return 'D'; break; } case 5: { return 'D'; break; } return grade; } }

Answers (2)