You are viewing a single comment's thread. Return to all comments →
int marks_summation(int* marks, int number_of_students, char gender) { int boys_marks = 0, girls_marks = 0; if (gender == 'b') { for (int i = 0; i < number_of_students; i+=2) { boys_marks += marks[i]; } }else{ for (int i = 1; i < number_of_students; i+=2) { girls_marks += marks[i]; } } return (gender == 'b')? boys_marks: girls_marks; }
Seems like cookies are disabled on this browser, please enable them to open this website
Students Marks Sum
You are viewing a single comment's thread. Return to all comments →