How to resolve this error?

you have not input the value of n

first input n and then declare array like this
int n;
int a[n];
it will work

@vanshikasharma1645 please close the doubt if you are done with this and do rate your experiance