I learned how to use struct when I try to write a program i face some misstakes which I cant correct
This is the program:
-------------------------------------------------------
[code=c]
#include<stdio. h>
#include<string .h>
main()
{int nu,i; /* nu is number of student */
struct record{ char id[8];
char name[35];
float gpa; }student;
printf("Enter the number of students");
scanf("%d",&nu) ;
for(i=0;i<nu;i+ +)
{ printf("Enter the ID of the student");
scanf("%d",%stu dent[i].id);
printf("Enter the name of student");
gets(student[i].name);
printf("Enter the GPA");
scan("%f",stude nt[i].gpa);}
}
[/code]
----------------------------------------
It cannot be compiled completly.
May any one plz help me and see where is the mistakes??
This is the program:
-------------------------------------------------------
[code=c]
#include<stdio. h>
#include<string .h>
main()
{int nu,i; /* nu is number of student */
struct record{ char id[8];
char name[35];
float gpa; }student;
printf("Enter the number of students");
scanf("%d",&nu) ;
for(i=0;i<nu;i+ +)
{ printf("Enter the ID of the student");
scanf("%d",%stu dent[i].id);
printf("Enter the name of student");
gets(student[i].name);
printf("Enter the GPA");
scan("%f",stude nt[i].gpa);}
}
[/code]
----------------------------------------
It cannot be compiled completly.
May any one plz help me and see where is the mistakes??
Comment