Classify Student Grades

CBeginner
Practice Now

Introduction

In this challenge, you will create a C program to automatically categorize student performance based on their exam scores using conditional statements. The program should handle scores from 0 to 100 and print the corresponding letter grade (A, B, C, D, or F) based on the given grade ranges.

Classify Student Grades

As a teaching assistant, you'll create a program to automatically categorize student performance based on their exam scores using C programming conditional statements.

Tasks

  • Create a C program that converts numeric scores to letter grades
  • Use conditional statements (if-else) to classify grades
  • Handle scores from 0 to 100
  • Print the corresponding letter grade based on the score range

Requirements

  • Create the program in ~/project/grade_classifier.c
  • Use the following grade ranges:
    • 90-100: A
    • 80-89: B
    • 70-79: C
    • 60-69: D
    • 0-59: F
  • Use if-else statements for grade classification
  • Program should accept a numeric score as input
  • Print the letter grade to the console

Examples

Run the program with different score inputs to verify the grade classification:

gcc grade_classifier.c -o grade_classifier
./grade_classifier

Example Outputs

Input Output
95 A
85 B
75 C
65 D
57 F

Hints

  • Use multiple if-else statements to check score ranges
  • Remember to handle each grade range separately
  • Use comparison operators like >= and <
  • Consider the order of your conditional checks
✨ Check Solution and Practice

Summary

In summary, this challenge requires you to create a C program that can automatically classify student grades based on their exam scores. The program should use conditional statements to handle scores from 0 to 100 and print the corresponding letter grade (A, B, C, D, or F) based on the given grade ranges.