Write a program using function template that ask user to enter the 10 elements in the array of type int and float and display the five largest value in ascending order.
Here's a program using function templates to find the five largest values in an array of integers or floats in ascending order: #include <iostream> #include <algorithm> using namespace std; template <typename T> void findLargestValues(T arr[], int size, int n) { // sort the array in descending order sort(arr, arr + size, greater<T>()); // print the largest n values in ascending order cout << "The " << n << " largest values are: "; for (int i = 0; i < n; i++) { cout << arr[size - i - 1] << " "; } cout << endl; } int main() { int intArr[10]; float floatArr[10]; // read integers from user input cout << "Enter 10 integers: "; for (int i = 0; i < 10; i++) { cin >> intArr[i]; ...