Having trouble while solving an array problem that produces an infinite loop.Please show me the way out. Thank you : Ask the user for a number between 1 and 9. If the user does not enter a number between 1 and 9, repeatedly ask for an integer value until they do. Once they have entered a number between 1 and 9, print the array.Given the array- int array[] = { 4, 6, 7, 3, 8, 2, 1, 9, 5 };

    #include<iostream>

    int printArray(){
	int arraySize,i;
    int array[] = { 4, 6, 7, 3, 8, 2, 1, 9, 5 };
 	
    arraySize=sizeof(array)/sizeof(array[0]);
    std::cout<<"The length of the array is:"<<" "<<arraySize<<"\n";

	for(i=0;i<arraySize;i++){
	std::cout<<array[i]<<"\n";
     }
      }
     int main(){
 
 	
      tryAgain:
	  int x;
       std::cout<< "Enter any number between 1 and 9"<<"\n";
       std::cin>>x;
  
       if(x<=9 && x>=1){
  	    printArray();
        }
        else
         goto tryAgain;
           return 0;
          }

