Guest User

Untitled

a guest
Feb 9th, 2015
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. void Analyze_array(int* arr, int arr_size, int *x1, int *x2, double
  2. *x3)
  3. {
  4. int min = arr[0];
  5. int max = arr[0];
  6. int sum = 0;
  7. int counter;
  8. for (counter = 0; counter < arr_size; counter++)
  9. {
  10. if (arr[counter] < min) min = arr[counter];
  11. if (arr[counter] > max) max = arr[counter];
  12. sum += arr[counter];
  13. }
  14. *x1 = min;
  15. *x2 = max;
  16. *x3 = (double)sum / arr_size;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment