hi
i wroth this program :
as soon as i change gets to scanf in /*/line it works properly otherwise it does not work!!
i woner why??
the problem is with the second gets as if it does not works
i have to use gets because i need to read in a string instead of a word!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct{
char name[30];
float mark;
}person;
main(){
person m1;
person n1;
int flag=0,counter=0;
puts("enter the first name");
gets(m1.name);
puts("enter the correspondence mark");
flag=scanf("%f",&m1.mark);
while (flag!=EOF){
counter++;
printf("enter the next name\n");
/*/ gets(n1.name);
printf("enter the correspondence mark\n");
flag=scanf("%f",&n1.mark);
if(n1.mark>m1.mark)
m1=n1;
}
if(counter)
printf("the best student is %s and his mark is %.2f",m1.name,m1.mark);
else
puts("you did not enter any record");
}