Help me in solving LPYAS165 problem

My issue

Pattern Wave
Take an integer
N
N as input print the following wave pattern as the output.
N

5
N=5






My code

#include <stdio.h>

void wave_pattern(int n){
	for(int i=0;i<n;i++){
	    for(int j=0;j<n;j++){
	        if(i==0 || i==n-1){
	            if(j%2==0){
	                printf("*");
	                }else{
	                    printf(" ");
	                }
	    }
	    else if(i == j || i+j==n-1){
	        printf("*");
	    }else{
	        printf(" ");
	    }
	}
	printf("\n");
	}
}
int main(){
    int N;
    scanf("%d",&N);
    if(N<3 || N%2==0){
        return 1;
    }
    wave_pattern(N);
    return 0;
}

Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300B/problems/LPYAS165