#include<stdio.h>
#include<stdlib.h>
char letter_grade(int point);
int main()
{
int points;
char grade;
printf("ENTER YOUR POINTS:");
scanf("%d",&points);
grade=letter_grade(points);
printf("\nYour grade is %c\n\n",grade);
system("PAUSE");
}
char letter_grade(int points)
{
char grade;
if(points>=80&&points<=100)
grade='A';
else
if(points>=60&&points<=79)
grade='B';
else
if(points>=50&&points<=59)
grade='C';
else
if(points>=40&&points<=49)
grade='D';
if(points>=30&&points<=39)
grade='E';
else
if(points<30)
grade='F';
return(grade);
}

No comments:
Post a Comment