Computer Science, asked by ramgopalagarwal, 10 months ago

Write a program to accept 10 numbers in an Array and find sum of odd numbers and product of even numbers.​

Answers

Answered by japleenjhamb
0

Answer:

Explanation:

int i, num, odd_sum = 0, even_sum = 0;

printf("Enter the value of num\n");

scanf("%d", &num);

for (i = 1; i <= num; i++)

if (i % 2 == 0)

even_sum = even_sum + i;

odd_sum = odd_sum + i;

printf("Sum of all odd numbers = %d\n", odd_sum);

Similar questions