I executed the same code in compileonline.com and in Xcode, I got the wrong result in Xcode but correct result in compileonline.com
For the following code
#include <iostream> 
using namespace std;
int main()
{
    int n=0,i,x[n],y[n];
    // insert code here...
    cout << "Enter number of inputs\n";
    cin >> n;
    for (i=0;i<n;i++)
    {
        cin >> x[i];
        cin >> y[i];
    }
    //print x
    for ( i=0;i<n;i++)
    {
        cout << x[i];
    }
    cout << "Test1";
    //print y
    for ( i=0;i<n;i++)
    {
        cout << y[i];
    }
}
for http://www.compileonline.com/
Input :
1 5 6
Output :
Enter number of inputs
5Test16
for Xcode,
Input :
1 5 6
Output :
Enter number of inputs
6Test16
 
     
     
     
     
    