The only problem is this part:

Code:

" num[i] ^= num[i+1];
num[i+1] ^= num[i];
num[i] ^= num[i+1]; "
#include <iostream>
#include <cmath>
using namespace std;
double integrate(double lower, double upper);
double f(double x);
int main()
{
int i, j;
int ranges[][2] = {{0,1},{1,2},{2,3},{3,4},{4,5},{5,6},
{6,7},{7,8},{8,9},{9,10}};
double num[10];
for(i=0; i<10; ++i)
num[0] = integrate(ranges[i][0],ranges[i][1]);
i = 0;
while ((i+1) < 10) {
if (num[i] > num[i+1]) {
num[i] ^= num[i+1]; // from here to
num[i+1] ^= num[i];
num[i] ^= num[i+1]; here, it shows an error //
if (i > 0) i = i -1;
} else {
i += 1;
}
}
for(i=0; i<10; ++i)
cout << num[i] << endl;
return 0;
}
double integrate(double lower, double upper)
{
double n = 0.0;
double dx = (upper-lower)/2000;
for (double i = lower; i < upper-dx; i += dx)
{
n += sin(i)*dx;
}
return n;
}
double f(double x)
{
return sin(x);
}

I tried to sort this code from smallest to largest.