int fun(int *A, int n, int elem) { int index = 0; int j = 0; while(j < n){ if(A[j] != elem){ A[index++] = A[j]; } j++; } return index; }