Help me in solving RATINGINPRAC problem

My issue

i think my logic is correct but i have error while running\

My code

#include <stdio.h>
#include <string.h>

int main() {
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++){
        int n;
        scanf("%d",&n);
        int a[n];
        for(int j=0;j<n;j++){
            scanf("%d ",&a[j]);
        }
        for(int j=1;j<n;j++){
            if(a[j]<a[j-1]){
                printf("no\n");
                return 0;
            }
        }
        printf("yes\n");
    }


    return 0;
}

Learning course: Arrays using C
Problem Link: CodeChef: Practical coding for everyone

@ganesh_2509
Have corrected your code .

#include <stdio.h>
#include <string.h>

int main() {
    int t;
    scanf("%d",&t);
    for(int i=0;i<t;i++){
        int n;
        scanf("%d",&n);
        int a[n];
        for(int j=0;j<n;j++){
            scanf("%d ",&a[j]);
        }
        int ch=0;
        for(int j=1;j<n;j++){
            if(a[j]<a[j-1]){
                ch=1;
            }
        }
        if(ch)
        printf("no\n");
        else
        printf("yes\n");
    }


    return 0;
}