Question: Rewrite the printReverse() function as a function a template. void printReverse(double list[], int n); void printReverse(int list[], int n); int main(void) } int n
Rewrite the printReverse() function as a function a template. void printReverse(double list[], int n); void printReverse(int list[], int n); int main(void) } int n = 6; double lista [10] = {12.1, 30.5, 14.2, 70.5, 32.0, 90.2}; int listB [10] = {12, 30, 14, 70, 32, 90}; /*===== This function takes an array of doubles and its actual size and it prints it in reverse order } printReverse(listA, n); printReverse(listB, n); return 0; */ void printReverse(double list[], int n) { } for (int i = n - 1; i >= 0; i--){ cout < < list[i] < < "1 } cout < endl; /*==== This function takes an array of ints and its actual size and it prints it in reverse order */ void printReverse(int list[], int n) { for (int i = n - 1; i >= 0; i--){ cout
Step by Step Solution
There are 3 Steps involved in it
The image you shared is showing code snippets written in C that include a main function and two defi... View full answer
Get step-by-step solutions from verified subject matter experts
