Take a look at this function call
curve = Curve(info, i);
Your passing i = 0 and what do you think will happen in this function when n = 0?
int Curve(Grades g[], int n)
{
int avg, curve, i, data;
int sum = 0;
int count = 0;
for (i = 0; i < n; i++)//n = 0
{
data = g[i].grade;
sum = sum + data;
count++;//never reach this
}
avg = sum / count;//what happens here? count = 0
curve = 75 - avg;
return curve;
}
gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0