c++ - How to avoid multiple print in screen? -
i wrote sample program on c++ print student's markdetails using while loop. print records properly. last record print 2 times in screen. have checked in file, there correct. sample code below.
fread.open("marks.inf",ios::in); { fread>>name1>>mm1>>mm2>>mm3>>mm4>>mm5; cout<<name1<<'\t'<<mm1<<'\t'<<mm2<<'\t'<<mm3<<'\t'<<mm4<<'\t'<<mm5<<'\t'<<endl; } while(fread); fread.close();
my output is:
dinu 90 90 90 90 88 venis 96 49 90 88 78 veni 89 89 88 78 66 veni 89 89 88 78 66
in output, veni print 2 times in screen. how avoid issue?
Comments
Post a Comment