This is a program to read & display a students data (name , date of birth, gpa).
I do not understand where is the problem, it displays syntax error before }
token(line 14) & syntax error before struct (line 8). Any good advice?
Thank you in advance.
#include<stdio.h>
#include<stdlib.h>
void main ()
typeof struct
{
char name[10] ;
date DOB ;
float gpa;
}
student ;
typeof struct
{
int day , month , year ;
}
date;
printf("enter number of students n ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("enter student % data(name , date of birth & gpa )");
scanf("%s%d%lf",i+1, &a[i].name , &a[i].DOB.day, &a[i].DOB.month, &a[i].DOB.year , &a[i].gpa);
}
for(i=0;i<n;i++)
{
printf("nmae : %s\t date of birth : %d \t gpa : %lf\t",i+1, a[i].name , a[i].DOB , a[i].gpa);
}