/** 9. Write a C++ program that reads all the integers from a file ``int.txt'', stores them in an array called {\em myintarray}, and then prints the integers to the console in reverse order. (Hint: Use a for-loop on the array). **/ //using dynamic array -- does two passes through the file - you can read any # of integers #include #include #include using namespace std; int main () { char in_name[15]; int a,i=0,c,n,sum; int *myarray; ifstream infile; cout<< "Enter input file name\n"; cin>>in_name; infile.open(in_name); if(infile.fail()){ cout<<"Failed to open input file\n"; exit(1); } /* get a count of integers in the file */ while (infile >> a){ i++; } /* allocate memory */ myarray=new int[i]; infile.clear(); // forget we hit the end of file infile.seekg(0, ios::beg); // move to the start of the file i=0; /* read file again */ while (infile >> a){ myarray[i]=a; i++; } for (int j=i-1; j>= 0;j--) { cout<<"myarray["<