Question: 13.4 Program: Minimum Value (C++) Write a function template FindSmallest() that returns the smallest value (minimum) in an array of numbers (ints, doubles, floats, unsigned

13.4 Program: Minimum Value (C++)

Write a function template FindSmallest() that returns the smallest value (minimum) in an array of numbers (ints, doubles, floats, unsigned ints, etc.) that is passed to it. You will also pass a value that holds the number of values in the array being based.

template T FindSmallest(T * a, int n) 

Write a test program that uses the function template above on an array of ints and an array of doubles; you may just use arrays declared with initializers.

L

Lab Submission

13.4.1: Program: Minimum Value

Instructions

Deliverables

FindSmallest.cpp

We will expect the above file(s) to be submitted

Compile command

g++ FindSmallest.cpp -Wall -o a.out

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!