want this code in C# ,
void sort(int *a, int size)
{
int i,j, swapped=0;
for (j=size-1; j>0; j--) {
swapped=0;
for (i=0; i<j; i++) {
if (a[i+1] < a[i]) {
swap(a[i], a[i+1]); swapped=1
}
}
if ( swapped == 0 ) break;
}
}