For this Question: Numbers are awesome, the xor of them is more.
You are given an array A of N natural numbers. For each A[i], you need to find the Xor Value, A[i]^A[i+1]^A[i+2]^...^A[n].
Find the sum of Xor values for each element A[i].The first line of the input contains an integer N denoting the number of elements in the array.
The next line contains N single spaced integers.

<b>Constraints</b>
1 <= N <= 100000
1 <= A[i] <= 1000000000Output the single integer, the sum of Xor values for each element in array.
Note:-you may need to use long longSample Input 
5
1 2 3 4 5

Sample Output
9

<b>Explanation</b>
Xor values are as follows: 1, 0, 2, 1, 5 and their  sum is 9, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
int main(){

    int n,k;
    cin>>n;
    int a[n];
    long long sum=0;
    for(int i=0;i<n;i++){
        cin>>a[i];sum^=a[i];
    }
    long long res=0;
    for(int i=0;i<n;i++){
       res+=sum;
       sum^=a[i];
    }


    cout<<res<<endl;
}

, In this Programming Language: C++, Now tell me if this Code is compilable or not?