Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void mult2(int a[], double b[], int n);
- void mult3(int a[], double b[], int n) {
- int *pint;
- double *pdouble;
- for (pint = a, pdouble = b; n-- ; pint++, pdouble++) {
- *pdouble = (double)*pint * 2.0;
- }
- }
- double sum(double v) {
- int i;
- double a2[4];
- int a1[4] = {1,2,3,4};
- mult2(a1, a2, 4);
- for (i = 0; i < 4; i++)
- v += a2[i];
- if (v > 10.0)
- printf("Maior que 10: %f\n", v);
- return v;
- }
- int main() {
- printf("%f\n", sum(1.0));
- return 0;
- }
Add Comment
Please, Sign In to add comment