logo

Crowdly

What will be the output of the following C code? #include <stdio.h> int main()...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What will be the output of the following C code?

#include <stdio.h>

int main() {

    int arr[] = {10, 9, 8, 7, 6, 5, 4, 3, 2};

    int n = sizeof(arr) / sizeof(arr[0]);

    int s1 = 0, s2 = 0;

    for (int i = 0; ++i < n / 2; i) {

        s1 += arr[i];

        s2 += arr[n - 1 - i];

    }

    printf("%d %d\n ", s1, s2);

    return 0;

}

0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on do.ipo.kpi.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!