i am a beginner. i am on my first problem and its not working. i really want help.

the question is to find max and min of n numbers .

the code is not working as it is supposed to, my code is-

```
#include<stdio.h>
```

int main()

{

int n,m,i,max,min,num1,num2,x,y,temp;

int large[100],small[100],index1=1,index2=1;

```
printf("Give N :
```

“);

scanf(”%d",&n);

printf("N=%d

",n);

```
scanf("%d",&max);
min=max;
m=n-1;
if(n%2==0){
scanf("%d",&min);
m=m-2;}
if(min>max){
temp=max;
max=min;
min=temp;
}
```

for(i=1;i<=m/2;m++){

```
scanf("%d %d",&num1,&num2);
if(num1<num2)
{
temp=num1;
num1=num2;
num2=temp;
}
if(num1>max) max=num1;
if(num2<min) min=num2;
```

}

printf("Max of given N numbers is : %d

Min of given N numbers is : %d

",max,min);

```
return 0;
```

}