I want to write a program in c that takes the name of a student it's age and some grades and put those in a two dimensional array, i input the first name as BigFirstName , the last name as BigLastName, the age as 18, the math grade as 100, the physics grade 100, and the average of the two 100 but it dosen't print them out like that, instead it prints:
BigFirstBigLastN18
BigLastN18
18
100
100
100
Here is my code:
#include <stdio.h>
char *Grades[1][6];
int line=0;
int column=0;
int main(void) {
printf("Input Firstname \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Lastname \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input age ");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Math Grade \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Physics Grade \n");
scanf(" %s",&Grades[line][column]);
column+=1;
printf("Input Average Bettween the two \n");
scanf(" %s",&Grades[line][column]);
column+=1;
int p;
for (p=0;p<7;p++){
printf ("%s\n",&Grades[0][p]);
}
return 0;
}