We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int* solve(int grades_size, int* grades, int *result_size){
// Complete this function
int i, g, r;
for (i=0; i<grades_size; i++) {
g = grades[i];
if (g < 38) continue;
if ((r = g%5) > 2) grades[i] = g + 5 -r;
}
*result_size = grades_size;
return grades;
}
All comments most welcome, thanks.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
C Function -
int* solve(int grades_size, int* grades, int *result_size){
}
All comments most welcome, thanks.