//Read in 5 numbers, find the total, echo to file #include #include using namespace std; int main() { bool outok=true; ofstream out; //output file stream out.open("c:/mycpp/numbers.txt"); //associates the name inch with a file if (out.fail()) //maybe the location doesn't exist, or it is full, or protected outok=false; double num,total=0; int i; for (i = 0; i<5; i++) { cout<<"Enter a number:"; cin>>num; if(outok) out<<"Enter a number:"<