C++ Program to Display Grade of Student

In this program, the user is ask for his/her percentage, then its grade will be shown on screen.



Source Code
#include<iostream>
using namespace std;

int main()
{
    int per;

    cout<<"Enter the percentage: ";
    cin>> per;

    switch(per/10)
    {
        case 10:
        case 9:
        case 8:
        case 7: cout<<"You got Distinction";
                break;
        case 6: cout<<"You got First Class";
                break;
        case 5: cout<<"You got Second Class";
                break;
        case 4: cout<<"You are Pass";
                break;
        case 3:
        case 2:
        case 1: cout<<"You are Fail";
                break;
        default: cout<<"Enter correct per";
    }
    return 0;
}
Output
Enter the percentage: 59
You got Second Class