rendered paste body#include <iostream>
using namespace std;
int main()
{
int array1[2];
int i = 0;
int total = 0;
int subtotal = 0;
for(i=0;i<3;i++)
{
cout << "Enter a number " << endl;
cin >> array1[i];
}
cout << "outside 1st FOR loop" << endl;
for(i=0;i<3;i++)
{
cout << "number was" << array1[i] << endl;
}
cout << "outside 2nd FOR loop" << endl;
for(i=0;i<3;i++)
{
array1[i] = subtotal;
subtotal += total = total;
}
cout << "outside 3rd FOR loop" << endl;
cout << "array total is" << total << endl;
//cin.get();
system("pause");
return 0;
}