### Arrays Highest/Smallest

Hey guys back for some more help :)

I'm onto Arrays and I'm meant to print out the highest array and its value
so I'm just wondering how thats coded.

I'm asking for a solution I guess and an explanation behind it.
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051`` ``````#include using namespace std; int main () {double Department[10], sales, totsales=0, salesAVG, SalesDiff, LowSale, HighSale; int Deptno; //Setting Deptno to 0 for(Deptno=0; Deptno<10; Deptno++) Department[Deptno] = 0.0; //Storing sales to Department for(Deptno=0; Deptno<10; Deptno++) { cout << "\n Enter sales of Department " << Deptno+1; cin >> sales; Department[Deptno]=sales; totsales= totsales + sales; } //Print out sales of each Department for(Deptno=0; Deptno<10; Deptno++) { cout << "\n Sales for department "<< Deptno+1<<"="<< Department[Deptno]; } // Print average sales salesAVG = totsales/10; cout<< "\n Sales for each department= " << salesAVG <> Deptno; cout << "\n Sales for department " << Deptno << " = " << Department[Deptno-1] << endl; // Difference in sales for (Deptno=0;Deptno<10;Deptno++) { cout << "\n Department " << Deptno+1 << " Sales = " << Department[Deptno] //This line is continuing <<" Difference= "<< Department[Deptno]-salesAVG << endl; } //Print Department with the highest sales and the sales for (Deptno=0; Deptno<10; Deptno++) { HighSale=Department[Deptno-1] > system("pause"); return 0; }``````

 ``1234567891011`` ``````double highest = Department[0] /*assume that the first array's value is the highest/* /*then u can compare whether the next array is higher or not, until the last array.*/ for(std::size_t index = 1 ; index < 10; index++) { if(Department[index] > highest) highest = Department[index]; } std::cout<<"the highest value is = "<