C program to read salary of an employee and print grade.
Solution:
In this program, salary of employee accepted as an input from user. According to the salary print grade of the employee.
Output:

| Salary | Grade |
|---|---|
| >=30000 | A |
| 20000-30000 | B |
| 10000-20000 | C |
| <10000 | D |
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:



