Write a c program to print largest number with its position in an array

#include <stdio.h>
void main() {
    int n,i; 
    int a[n],max,pos=0;
    printf("Enter a total number of values");
    scanf("%d",&n);
    printf("Enter all number");
    for(i=0;i<n;i++){ 
        scanf("%d",&a[i]); 
        if(i==0||a[i]>max){
            max=a[i]; 
            pos=i;
        }
    }
    printf("Max=%d at pos=%d",max,pos);
    
}