You are viewing a single comment's thread. Return to all comments →
Would this be better? For reability only. Im not sure. It's really the same solution.
int res = new int[grades.Length];
for (int i = 0; i < grades.Length; i++)
int current = grade[i];
if (grades[i] % 5 > 2 && !(grades[i] < 38))
current = grades[i] + (5-grades[i]%5);
res[i] = current;