Skip to content

Instantly share code, notes, and snippets.

View NeoMindStd's full-sized avatar
🎅

NeoMind NeoMindStd

🎅
View GitHub Profile
#include <stdio.h>
#define NUMBER_OF_PEOPLE 4
#define NUMBER_OF_SUBJECTS 3
void score_sum_avg(int *pScore, int subjects, int *pSum, float *pAvg) {
*pSum = 0;
for (int i = 0; i < subjects; i++) {
*pSum += *(pScore + i);
}
*pAvg = (float)(*pSum) / (float)subjects;