Hi guys,
I am trying to help my friend, he is using V C++.
The problem that we are having is this error message:
Here is the error message :Code:#include <iostream.h> float v1,v2,v3,v4,v5; void getValues() { cout<<" Please enter the first Value: " ; cin>> v1; cout<<" Please enter the secod Value: " ; cin>> v2; cout<<" Please enter the Third Value: " ; cin>> v3; cout<<" Please enter the Fourth Value: " ; cin>> v4; cout<<" Please enter the Fifth Value: " ; cin>> v5; } float CalcAvarage (float v01, float v02, float v03, float v04, float v05) { float ave; float scores[5]; scores[0]= v01; scores[1]= v02; scores[2]= v03; scores[3]= v04; scores[4]= v05; float temp; for (int i=0; i<5; i++) for ( int j= i+1; j<5; j++) if( scores[i] <= scores[j]){ temp = scores[i]; scores[i]= scores[j]; scores[j] = temp; }// end if for ( i=0; i<5; i++){ cout<<" Arrange the scores like " << i<< " is : "<< scores[i]; } cout<<endl<<endl;; for( i=0; i<4; i++){ ave += scores[i]; } ave = ave /4; return ave; } float findLowest () { float lowest; lowest= v1; if (lowest <= v2) lowest = v2; if (lowest <= v3) lowest = v3; if (lowest <= v4) lowest = v4; if (lowest <= v5) lowest = v5; return lowest; } int main() { float ave0; float lowest; getValues(); lowest = findLowest(); ave0 = CalcAvarage(v1, v2, v3, v4, v5); return 0; }
Fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
update, there is no error message, but the program crash.
p2.dll - 1 error(s), 0 warning(s)



LinkBack URL
About LinkBacks


