int sum(int *arr, int n) { int i, result=0; for (i=0;i