C program to calculate the sum of odd and even numbers

#include <stdio.h>

int main() {
    int n, i, sum_even = 0, sum_odd = 0;

    printf("Enter the number of elements: ");
    scanf("%d", &n);

    int arr[n];

    printf("Enter the elements: ");
    for(i = 0; i < n; i++) {
        scanf("%d", &arr[i]);
    }

    for(i = 0; i < n; i++) {
        if(arr[i] % 2 == 0) {
            sum_even += arr[i];
        } else {
            sum_odd += arr[i];
        }
    }

    printf("Sum of even numbers: %d\n", sum_even);
    printf("Sum of odd numbers: %d\n", sum_odd);

    return 0;
}

This program prompts the user to enter the number of elements and then the elements themselves. It calculates the sum of even numbers and the sum of odd numbers separately. Finally, it prints out the sums of even and odd numbers.