For this program, I"m trying to print a table of random grades of double value between 50-100, listing each in the columns for the various assignments. When I compile my code, I get an error "'%6.2f' expects type 'double', but argument 2 has type 'double (*)[6]'"
Code:
/*
* File: Assignment2.c
* Author: Anthony
*
* Created on November 18, 2009, 8:45 AM
*/
#include <stdio.h>
#include <stdlib.h>
int main() {
double grade[15][6];
double total[15];
double average[7];
int i;
int j;
printf("\t\tHW1\tHW2\tQuiz1\tQuiz2\tMidterm\tFinal");
for(i=0; i<15; i++)
{
for (j=0; j<6; j++)
{
grade[i][j] = 50.0+rand() % 50;
printf("%6.2f\n", grade);
}
}
system("pause");
}
Any idea as to how I would fix this error and print each value in the arrays?