Grading Students

Grading Students from Hackerrank.com
https://www.hackerrank.com/challenges/grading/problem
[restrict …]

#include<stdio.h>
#include <stdlib.h>
int* gradingStudents(int grades_count, int* grades, int* result_count);
int main()
{
    int i,c,size;
    int a[]={73,67,38,33};
    int *p = NULL;
    size = (sizeof(a))/sizeof(a[0]);
    p = gradingStudents(size,a,&c);
    for(i=0;i<c;i++)
        printf("%d\n",p[i]);
    return 0;
}
int* gradingStudents(int grades_count, int* grades, int* result_count)
{
    int i;
    int k = 0,index = 0;
    int *p = NULL;
    p = (int*)malloc(sizeof(int) * grades_count);
    for(i=0;i<grades_count;i++)
    {
        if(grades[i] > 35)
        {
            if((grades[i] % 5) == 0)
            {
                p[index] = grades[i];
            }
            else if(((grades[i]+1) % 5) == 0 )
            {
                p[index] = grades[i]+1;
            }
            else if(((grades[i]+2) % 5) == 0 )
            {
                p[index] = grades[i]+2;
            }
            else
            {
                p[index] = grades[i];
            }
        }
        else
            p[index] = grades[i];
        index++;
    }
    index;
    *result_count = index;
    return p;
}

[/restrict]