Odd Life Code in C language

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Odd Life

Code in C language

Tests
Executions
main.c
+
6. Odd Life
1 #include<stdio.h>
by CodeChum Admin
2
// TODO: Declare the displayoddO function here
CE Run Tests
In life, anything can happen. Yesterday we're happy, tomorrow we're
4
int nain(void) {
- {
sad. One moment we're up, the next we're down.
5
Test Cases
int life[90]
1,3,2,4,5,7,6,8,9,11,
100,13,0,14,16,17,3,18,20,10,
12,8,15,14,-5,17,19,18,1,9,5,
10,13,11,14,16,22,0,18,20,3,
99,13,15,14,22,17,19,0,23,2,
12,13,15,22,16,17,56,18,44,99,
2,13,22,14,16 ,89,19,69,101,34,
12,22,15,14,78,17,69,18,2,33
};
6
7
Life's odd. But that's what makes it beautiful e
8
O Test Case 1 Hidden
In this program, let's try displaying all the odd numbers of our array,
life, but with the use of functions!
10
11
12
Instructions:
13
14
1. In the code editor, you are provided with an array called, life.
Furthermore, in the main(), a function call was made to the
15
16
17
displayodd(life, 90);
function displayOdd() where the array life was passed as well as
18
the size of life which is 90.
19
return 0;
2. Your task is to declare and define the function displayodd()
20 }
which has the following details:
21
1. Return type - void
22 // TODO: Define the displayodd ) function here
2. Name - displayodd
3. Parameters
1. int* - an array
2. int - the size of the array
4. 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
Transcribed Image Text:Tests Executions main.c + 6. Odd Life 1 #include<stdio.h> by CodeChum Admin 2 // TODO: Declare the displayoddO function here CE Run Tests In life, anything can happen. Yesterday we're happy, tomorrow we're 4 int nain(void) { - { sad. One moment we're up, the next we're down. 5 Test Cases int life[90] 1,3,2,4,5,7,6,8,9,11, 100,13,0,14,16,17,3,18,20,10, 12,8,15,14,-5,17,19,18,1,9,5, 10,13,11,14,16,22,0,18,20,3, 99,13,15,14,22,17,19,0,23,2, 12,13,15,22,16,17,56,18,44,99, 2,13,22,14,16 ,89,19,69,101,34, 12,22,15,14,78,17,69,18,2,33 }; 6 7 Life's odd. But that's what makes it beautiful e 8 O Test Case 1 Hidden In this program, let's try displaying all the odd numbers of our array, life, but with the use of functions! 10 11 12 Instructions: 13 14 1. In the code editor, you are provided with an array called, life. Furthermore, in the main(), a function call was made to the 15 16 17 displayodd(life, 90); function displayOdd() where the array life was passed as well as 18 the size of life which is 90. 19 return 0; 2. Your task is to declare and define the function displayodd() 20 } which has the following details: 21 1. Return type - void 22 // TODO: Define the displayodd ) function here 2. Name - displayodd 3. Parameters 1. int* - an array 2. int - the size of the array 4. 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
Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY