while running, max is giving desired maximum number from the list of numbers but the min is not giving minimum number which it is supposed to give.?
For example:

If the input is :

> 
> 5   
> 
> 45 7 2 1 4
> 
> 
> 

The output from the below code is:

> 
> Maximum number is 45
> 
> 
> Minimum number is 0
> 
> 
> 

Why ?

```
#include <stdio.h>
#include <limits.h>
#define MX 1000000

int max=INT_MIN;
int min=INT_MAX;

int findmax(int a[],int n)
{
    if(n<0)
        return max;
    if(a[n]>max)
    {
        max=a[n];
    }
    return findmax(a,n-1);
}

int findmin(int a[],int n)
{
    if(n<0)
        return min;
    if(a[n]<min)
    {
        min=a[n];
    }
    return findmin(a,n-1);
}

int main(void) {
    int a[MX],n,i;
    printf("Enter the number of elements:\n");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    printf("Maximum number is %d\n",findmax(a,n));
    printf("Minimum number is %d\n",findmin(a,n));
    return 0;
}

```