int main()
{
FILE *dp;
char name[15];
char sname[15];
int no;
char department[10];
char sex[3];
char city[15];
int age;
int phone;
int num;
dp=fopen("veri.dat","r");
if(dp==NULL)
{
printf("file couldnt opened\n");
return 1;
}
printf("enter student number:\n");
scanf("%d",&num);
while(!feof(dp))
{
fscanf(dp,"%d",&no);
if(no==num)
{
printf("%s%s%d%s%s%s%d%d",name,sname,no,department,sex,city,age,phone);
}
}
fclose(dp);
system("pause");
return 0;
}
I am new in c. Can you help with my codes?