Help me in solving WATERCONS problem

My issue

code for this

My code

#include <stdio.h>

int main(void) {
    int x;
    scanf("%d",&x);
    if(x >= 2000){
        printf("YES");
    }
   
    else
    {
        printf("NO");
    }
	
	return 0;
}


Learning course: Practice C
Problem Link: CodeChef: Practical coding for everyone

include <stdio.h>
int t;
int main(void) {
scanf(“%d” ,&t);
while(t–){
int x;
scanf(“%d”,&x);
if(x >= 2000){
printf(“YES”);
}

else
{
    printf("NO");
}
}
return 0;

}

why we are using while(t-)