Question: on 1 write a function that takes two integers x and y, and returns the average of odd numbers between x and y. et red

on 1 write a function that takes two integers x and y, and returns the average of odd numbers between x and y. et red d out of 3 question O a int print_odd (int x, int y) { int sum=0; for (int i=x;i
Step by Step Solution
There are 3 Steps involved in it
To find the average of the odd numbers between two integers x and y you should Sum the odd numbers between x and y Count the number of odd numbers Return the average by dividing the sum by the count Lets evaluate the options Options Analysis a Function int printoddint x int y Sums even numbers because it checks with if i20 Incorrect logic for summing odd numbers b ... View full answer
Get step-by-step solutions from verified subject matter experts
