Students Marks Sum

  • + 0 comments
    int sum = 0;
    
    for (int student = 0; student < number_of_students; student++) {
        if (gender == 'b') {
            sum += marks[student];
            student++;
        }
        else {
            student++;
            sum += marks[student];
        }
    }
    
    return sum;