How to this box in C? : %@@@%
%...%
%...%
%...%
%@@@%

Where is my mistake pls let me know i am beginner i just started programing. I would apreciate your help 
   

    #include<stdio.h>
    int main(){
	int i,j,num;
    scanf("%d", &num);
    
    for(i=0;i<num;i++){
        for(j=0;j<num;j++){
            if((i==0)||(i==num-1)){
            printf("@");
            }
            else if((j==i-1)||(j==num-1)){
            printf("%");
            }
            else
                printf(".");
        }
        printf("\n");
    }
}
