Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double foo(double *a, int n) {
- double x = 0.0;
- double y = 0.0;
- for (int i = 0; i < n; i += 2) {
- x += a[i];
- y += a[i + 1];
- }
- return x * y;
- }
- double bar(double *a, unsigned n) {
- double x = 0.0;
- double y = 0.0;
- for (unsigned i = 0; i < n; i += 2) {
- x += a[i];
- y += a[i + 1];
- }
- return x * y;
- }
Add Comment
Please, Sign In to add comment