C Programming : rite a c program for grading system of the students.

Posted on:
tags: ,

Q6: Write a c program for grading system of the students.



#include<stdio.h>
#include<conio.h>
void main()
{
int marks,sci,maths,social,eng,hindi,total;
float avg;
clrscr();
                printf("\t\tSTUDENT GRADES\n");

                printf("\nEnter the marks:");
                printf("\nFor ENGLISH:");
                scanf("%d",&eng);
                printf("\nFor HINDI:");
                scanf("%d",&hindi);
                printf("\nFor SCIENCE:");
                scanf("%d",&sci);
                printf("\nFor MATHEMATICS:");
                scanf("%d",&maths);
                printf("\nFor SOCIAL SCIENCE:");
                scanf("%d",&social);

                                total=eng+hindi+sci+maths+social;
                                avg=total/5;

                printf("\n\tTOTAL MARKS OBTAINED STUDENT: %d",total);
                printf("\n\n\tAVERAGE PERCENTAGE OBTAINED STUDENT: %f\n\n",avg);

                if(avg>=90)
                {
                                printf("\tGRADE: O");
                }
                if(avg>=80 && avg<90)
                {
                                printf("\tGRADE: E");
                }
                if(avg>=70 && avg<80)
                {
                                printf("\tGRADE: A");
                }
                if(avg>=60 && avg<70)
                {
                                printf("\tGRADE: B");
                }
                if(avg>=50 && avg<60)
                {
                                printf("\tGRADE: C");

                }
                if(avg>=40 && avg<50)
                {
                                printf("\tGRADE: D");
                }
                if(avg<40)
                {
                                printf("\tGRADE: F ");
                }
                printf("\nO:Outstanding\nE:Excellent\nA:Very Good\nB:Good\nC:Average\nD:Just Passed\nF:Failed");
getch();
}


No comments:

Post a Comment

< >