I am reading these values from a file
12.1
13.4
12.4find
gg
16.77
56.55
My program should display the average of 5 float no and ignore find and gg.
I did
while((inputfile >> f))
{
//cout << "ssss";
//continue;
//}
sum += f;
count ++;
cout << fixed << f << endl;
}
cout << setprecision(2) << fixed << count <<endl;
cout << "average : " << sum/count << endl;
but it shows
12.100000
13.400000
12.400000
3
average : 12.63
Any suggestions