Description - displays all the odd numbers found in the array passed, starting from the end.
(C PROGRAMMING ONLY)
2. Odd Life
by CodeChum Admin
In life, anything can happen. Yesterday we're happy, tomorrow we're sad. One moment we're up, the next we're down.
Life's odd. But that's what makes it beautiful ?
In this program, let's try displaying all the odd numbers of our array, life, but with the use of functions!
Instructions:
In the code editor, you are provided with an array called, life. Furthermore, in the main(), a function call was made to the function displayOdd() where the array life was passed as well as the size of life which is 90.
Your task is to declare and define the function displayOdd() which has the following details:
Return type - void
Name - displayOdd
Parameters
int* - an array
int - the size of the array
Description - displays all the odd numbers found in the array passed, starting from the end.
Output
Odd element at index 80: 33
Odd element at index 77: 69
Odd element at index 76: 17
Odd element at index 73: 15
Odd element at index 69: 101
.
.
.
.
Step by step
Solved in 4 steps with 2 images