C++ Template for finding Minimum value in an array

//Template for finding Minimum value in an array

#include
#include

template
T findMin(T arr[],int n)
{
int i;
T min;
min=arr[0];
for(i=0;i {
if(min > arr[i])
min=arr[i];
}
return(min);
}


void main()
{
clrscr();
int iarr[]={5,4,3,2,1};
char carr[]={'z','y','c','b','a'};
double darr[]={3.3,5.5,2.2,1.1,4.4};

//calling Generic function...to find minimum value.
cout<<"Generic Function to find Minimum from Array\n\n";
cout<<"Integer Minimum is : "< cout<<"Character Minimum is : "< cout<<"Double Minimum is : "<
getch();
}