Print grade of employee as per their salary - C

C program to read salary of an employee and print grade.

SalaryGrade
>=30000A
20000-30000B
10000-20000C
<10000D

Solution:

In this program, salary of employee accepted as an input from user. According to the salary print grade of the employee.

#include <stdio.h>
int main()
{
     int sal;
     printf("Enter Salary of Employee : ");
     scanf("%d",&sal);
     if(sal>=30000)
     {
          printf("\nGrade of Employee : "A"");
     }
     else if(sal>=20000)
     {
          printf("\nGrade of Employee : "B"");
     }
     else if(sal>=10000)
     {
          printf("\nGrade of Employee : "C"");
     }
     else
     {
          printf("\nGrade of Employee : "B"");
     }
     return 0;   
}


Output:

grade of employee