/* Title: Array Lab Assignment Date Written: 2 July 2001 Description: This program allows the user to input an array of 5 integers. The program will then compare the integers and display the largest integer in the array */ #include #include int main() { int j, arr[5], largest; // declare variables for (j = 0; j < 5; j++) { printf("input an integer: "); // input the array values cin >> arr[j]; } largest = arr[0]; // initialize the first array value for (j = 0; j < 5; j++) { if (arr[j] > largest) // routine to check for the largest integer largest = arr[j]; } // display largest integer cout << "The largest integer in the array is: " << largest << endl; return 0; }