Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. void mult2(int a[], double b[], int n);
  5.  
  6. void mult3(int a[], double b[], int n) {
  7. int *pint;
  8. double *pdouble;
  9. for (pint = a, pdouble = b; n-- ; pint++, pdouble++) {
  10. *pdouble = (double)*pint * 2.0;
  11. }
  12. }
  13.  
  14. double sum(double v) {
  15. int i;
  16. double a2[4];
  17. int a1[4] = {1,2,3,4};
  18. mult2(a1, a2, 4);
  19.  
  20. for (i = 0; i < 4; i++)
  21. v += a2[i];
  22.  
  23. if (v > 10.0)
  24. printf("Maior que 10: %f\n", v);
  25. return v;
  26. }
  27.  
  28. int main() {
  29. printf("%f\n", sum(1.0));
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment