Question: //C++ Write two regular c-type function templates called returnMinimum and returnMaximum that returns the smaller or the larger of two input arguments. In the main,

//C++

Write two regular c-type function templates called returnMinimum and returnMaximum that returns the smaller or the larger of two input arguments.

In the main, demonstrate the usage of both functions on data types int, double, char, and string. No user input.

#include #include

using namespace std;

template void returnMinimum(T* arr,int size);

template void returnMaximum(T* arr,int size);

int main(){

return 0; }

template void returnMinimum(T* arr, int size) { for (int i = 0; i < size; i++) {

cout << arr[i] << " "; } cout << endl; };

template void returnMaximum(T* arr, int size) { for (int i = 0; i < size; i++) {

cout << arr[i] << " "; } cout << endl; };

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!