void f2()
{
constint ARRAY_SIZE = 50;
int numbers[ARRAY_SIZE] ={0}; // zero array elements
int count = 0;
ifstream inputFile;
inputFile.open("filename.txt");
while ( (count < ARRAY_SIZE) && (inputFile >> numbers[count]) )
count++;
inputFile.close();
for (int index = 0; index < count; index++)
cout << numbers[index] << endl;
int total = 0;
for (int c= 0; c < count; c++)
total += numbers[c];
cout << total << endl;
system("pause");
return;
}