C program to calculate the Grade of Student using Percentage | Grading program in C


Find the grade of a student by reading marks or by taking Percentage. Here we are assuming greater than 80 percentage or marks as grade A, if the Marks are between 80-60 Grade is B, if the marks are between 60-40 grade is C, If student got marks below 40 it means he is Failed.

Algorithm : 

Step 1 : start
Step 2 : read marks or Percentage
Step 3 : if marks >= 80 then grade =A, go to step 7
Step 4 : if marks >= 60 and marks <=80 then grade = B, go to step 7
Step 5 : if marks >=40 and marks <=60 then grade = C go to step 7
Step 6 : display failed
Step 7 : display grade.
Step 8 : stop.

Flow Chart :


Program :

Output :

student grading Program in C
Output of Student Grading Program 

Related Programs :

  1. C program to Convert Temperature.
  2. C program to understand type conversation.
  3. finding Largest of two numbers using conditional operator in C.
  4. C program to calculate the simple Interest,
  5. C program to understand Size of Operator 
  6. 100 + More C programs


Hi Guys, I am Venkatesh. I am a programmer and an Open Source enthusiast. I write about programming and technology on this blog.

You may also like...

9 Responses

  1. Mary Rose says:

    Hi all, can you help me with this? “Create an algorithm and program that will ask the name of the student then, calculate the final grade of the student by getting the average of four quarter grades.”

  2. Devansh Upadhyay says:

    Draw a flowchart to print ‘A’ grade if marks is greater than 50 else print ‘B’ marks is greater than 30 otherwise fail

  3. Maryam malik says:

    Hello please help me
    Find the %mark secured by a student given all marks write it algorithm

  4. sidvaldez says:

    hey guys can u help me in this problem

  5. Vimalan says:

    Hey I need a favour. How do I do an algorithm, pseudocode and flowchart fo the attached program?

    #include // The Rounding Of Application //
    #include // To Copy The Score and Grade for sorting Purposes //

    char MATRICS[26][31], temp4[10], temp5[10];
    int i, M, N, O, P, count;
    float MANUAL[26], CAD[26], TEST1[26], TEST2[26], TEST3[26], PROJ[26], j[26];
    float MAN[26], CADK[26], TEST[26], PRO[26];
    float sum, aveg;
    float temp1, temp2, temp, temp3;
    float add;
    int total1=0, total2=0, total3=0, total4=0, total5=0, total6=0, total7=0, total8=0;

    FILE *in; // declare input data file //
    in = fopen( “project1.txt”, “r” ); // assign input data file //

    printf(“\n \n”);

    while(!feof(in)) // read input datafile and display until end of file //
    for(i=1; i<27; i=i+1)
    fscanf(in ,"%s %f %f %f %f %f %f", &MATRICS[i], &MANUAL[i], &CAD[i], &TEST1[i], &TEST2[i], &TEST3[i], &PROJ[i]);
    MAN[i] = MANUAL[i]*.2;
    CADK[i] = CAD[i]*.1;
    TEST[i] = ((TEST1[i]*.1) + (TEST2[i]*.1) + (TEST3[i]*.2));
    PRO[i] = PROJ[i]*.3;
    j[i] = MAN[i] + CADK[i] + TEST[i] + PRO[i];


    for (M=1; M<26; M=M+1) // start sorting process //
    for (i=1; i<26; i=i+1)
    if (j[i] < j[i+1]) // "<" Indicates for Descending Order //

    MAN[i]= MAN[i+1];
    MAN[i+1]= temp1;

    CADK[i]= CADK[i+1];
    CADK[i+1]= temp2;

    TEST[i]= TEST[i+1];
    TEST[i+1]= temp3;

    strcpy(temp4, MATRICS[i]);
    strcpy(MATRICS[i], MATRICS[i+1]);
    strcpy(MATRICS[i+1], temp4);



    for(i=1; i=80)
    printf(” A”);

    else if(round(j[i])>=75 && (j[i]=70 && (j[i]=65 && (j[i]=60 && (j[i]=55 && (j[i]=50 && (j[i]<55))
    printf(" C");

    printf(" FAIL");

    total1 += 1;

    else if((j[i]>=75) && (j[i]=70) && (j[i]=65) && (j[i]=60) && (j[i]=55) && (j[i]=50) && (j[i]<55))
    total7 += 1;

    total8 += 1;


    printf("\n\n\n *****Statistics Of Results!!!*****");

    printf("\n\n Total Number Of Students: 26");

    for(i=1; i=80)
    printf(“\n Average Grade: A\n”);

    else if((aveg>=75) && (aveg=70) && (aveg=65) && (aveg=60) && (aveg=55) && (aveg=50) && (aveg<55))
    printf("\n Average Grade: C-");


    printf("\n Number Of A : %i", total1);
    printf("\n Number Of A- : %i", total2);
    printf("\n Number Of B+ : %i", total3);
    printf("\n Number Of B : %i", total4);
    printf("\n Number Of B- : %i", total5);
    printf("\n Number Of C+ : %i", total6);
    printf("\n Number Of C : %i", total7);
    printf("\n Number Of 'Fail': %i", total8);


  6. Judy Nekoye says:

    Hey, kindly help me with this: Write a pseudocode that multiply positive integers x and y by using addition and subtraction only

    • Hi Judy,

      #include <stdio.h>
      int main(void) {

      int x, y, i, mul=0;
      printf("Enter x and y values : ");

      mul = mul + x;
      printf("Multiplication is : %d \n",mul);
      return 0;

      1) Take the input from user and store them in x and y.
      2) Now create a for loop, That will loop from 1 to the y.
      3) For each iteration we are going to add x to mul. Mul is variable which is initially 0 and we are adding x to mul. Means we are
      multiplying the value.
      4) This process will repeat until we reach the y. Once we reach, Loop will break and Multiplication value is stored in variable mul
      5) display the mul value on the console.


  1. […] C program to calculate the Grade of Student using Percentage | Grading program in C […]

  2. […] C program to calculate the Grade of Student using Percentage […]

Leave a Reply