Help me in solving RATINGINPRAC problem

My issue

how to read input

My code

#include <stdio.h>

int main(void) {
	// your code goes here
	int n,j,k;
	scanf("%d",&n);
	while(n--)
	{
	    scanf("%d",j);
	    int arr[j];
	    for(int k=1;k<=j;k++)
	    {
	        scanf("%d",&arr[k]);
	    }
	    for(int k=1;k<=n;k++)
	    {
	         if(arr[k]<arr[k-1])
	         {
	          printf("no");
	          }
	    }
	    printf("yes");
	    
	}
	
	return 0;
}


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

@madhu1213
In this problem u have to check whether the array is in increasing order or not.
U can do it like this

#include <stdio.h>

int main(void) {
	// your code goes here
	int t;
	scanf("%d",&t);
	while(t--)
	{
	    int n;
        scanf("%d", &n);
        int ch=0;
        int ratings[n];
        for (int i = 0; i < n; i++) {
            scanf("%d", &ratings[i]);
        }
    
        for (int i = 1; i < n; i++) {
            if (ratings[i] < ratings[i - 1]) {
                ch=1;
            }
        }
        if(ch)
        printf("No\n");
        else
        printf("Yes\n");
	}
	return 0;
}