Can someone help me to make my program output each element in the array that is user prompted

so far it.... prompts the user for input no more tan 50 elements and a value less the 999

it doesnt .... output the elements and sorts then in acending order
Code:
#include <iostream.h>
#include <iomanip.h>

int sort(int MYARRAY[], int p);
 const int LIMIT = 50;
    int MYARRAY[LIMIT];
int x,i,j,min,minx,temp,moves=0;
int value;
		
int main()
{
	for(x=0;x<LIMIT;x++)
{
	for(x=0;x<LIMIT;x++)
	{
	while(value < 999)
	{ 
		cout << "\n\nPlease enter a number: ";
		cin >> MYARRAY[x];
		value = value + MYARRAY[x];
		moves = sort(MYARRAY, LIMIT);
	}
	cout << MYARRAY[LIMIT];
	}

	cout << "\n\nThe sorted list, in ascending order, is:\n";
	cout << setw(4) << MYARRAY[LIMIT];
	cout << endl << moves << " moves were made to sort this list\n";
}
	return 0;
}

int sort(int a[], int n)
{

for(x=0;x<(LIMIT-1);x++)
	{
		min = MYARRAY[x];
		minx = x;
		for(j=x+1;j<i; j++)
		{
			if(MYARRAY[j] < min)
			{
				min = MYARRAY[j];
				minx = j;
			}
		}
		if (min < MYARRAY[x])
		{
			temp = MYARRAY[x];
			MYARRAY[x] = min;
			MYARRAY[minx]=temp;
			moves++;
		}
	}
return moves;
}