Created
June 19, 2018 12:40
-
-
Save tuliopaim/0205a64d3cfdc40d503fc868836275cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment