reverse - else // FILL IN Code to read value // FILL IN...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// Program Reverse reads numbers into an array // and prints them out in reverse order. / #include <iostream> #include <fstream> using namespace std; u const int MAX = 10; c int main () { int numbers[MAX]; ifstream inData; int index; int sum =0; inData.open("E:\\BackUp\\SkolStuffs\\U.C.C\\CSC\\Lab13\\reverse.dat"); for (index = 0; index < MAX; index++) { if (!inData) cout << "File cannot be opened"<<endl;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: else // FILL IN Code to read value // FILL IN Code to store value into numbers inData &gt;&gt; numbers[index]; } for (index = MAX - 1; index &gt;= 0; index--) cout &lt;&lt; numbers[index] &lt;&lt; endl;// FILL IN Code to write numbers on the screen for (index = 0; index &lt; MAX; index++) sum = sum + numbers[index]; cout &lt;&lt; &quot;Sum is &quot; &lt;&lt; sum &lt;&lt; endl; return 0; }...
View Full Document

Ask a homework question - tutors are online