Create a function named oddSum. This function will return thesum of every odd value in the array.
The function has two parameters:
- int arr[], an array of integers
- int size, the size of the array.
Use the following function definition:
// This is what I have but it keeps adding numbers that are notan odd value. It will just add every number in the array instead ofadding odd values only.
int oddSum(int arr[], int size){
int totalSum = 0;
if (size <= 0)
return 0;
else
for (int i = 0; i < size;i++)
{
if (arr[i % 2 !=0])
PayPal Gateway not configured
PayPal Gateway not configured