troubleshooting Question

# what about c++ its giving me issues

C++
``````int  minimum (int  scores )
{

int  min, i,j;
min = scores;

for ( i = 0;  i<4;  ++i )
for (j=0; j<3; ++j)
if ( scores[i][j] < min )
min= scores[i][j];
return min;

}

//function for Maximum Value
int maximum (int values)
{
int  max, i,j;

max = values;

for ( i = 0;  i<4;  ++i )
for (j=0; j<3; ++j)
if ( values[i][j] > max )
max= values[i][j];
return max;

}

//function for Average
float average (int values)
{float  sum=0.0;
int count=0;
float Average;
int i,j;

for(i=0;i<4;++i)
for(j=0;j<3;++j)
{
sum=sum+values[i][j];
++count;
}
Average=sum/count;
return Average;
}
//function to find student average
float studentavg (int values)

float finalmark;

finalmark=values;
{

for ( j=0;i<3;++j){

for(  i=0;i<4;++i){

int rowsum=rowsum+values[i][j];

finalmark=rowsum/3;
printf("Student's final mark is %.2f\n", finalmark);
}

}

//Main Program
int main (void)
{
int  values, i,j,min,max,sum=0,count=0;
float Average,finalmark;
int rowsum=0;
int  minimum (int  values);
int maximum (int values);
float average (int values);
float studentavg (int values);

printf ("Enter Values: \n");
for ( i = 0; i< 4; i++ ) {

for ( j = 0; j< 3; j++ ) {
printf(" values[%i][%i] = ", i,j, values[i][j] );
scanf("%i", &values[i][j]);
}
}
printf("\n");
printf("\n");
printf("\n");

min = minimum(values);
max = maximum(values);
Average = average(values);
finalmark=studentavg(values);

printf(" The minimum value is %i\n", min);
printf(" The maximum value is %i\n", max);
printf (" The Class final mark is %.2f\n", Average);

return 0;
}

}

}
``````
phoffricSoftware Engineering and Matlab Analyst
###### Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.