You are viewing a single comment's thread. Return to all comments →
You can do the same thing in C# ->
return grades.Select(grade => grade < 38 || (grade % 5 < 3) ? grade : grade + (5 - grade % 5 )).ToArray();
Excellent
Can you please also tell me that ToArray is to be used only when we are returning an array?
foreach(`$grades as $`grade){
grade < 38 || grade : grade % 5))); } return $g;
php code
Grading Students
You are viewing a single comment's thread. Return to all comments →
You can do the same thing in C# ->
return grades.Select(grade => grade < 38 || (grade % 5 < 3) ? grade : grade + (5 - grade % 5 )).ToArray();
Excellent
Can you please also tell me that ToArray is to be used only when we are returning an array?
grade < 38 || grade : grade % 5))); } return $g;
php code