5. Preserving the Gene Pool by CodeChum Admin In order to make sure that the future generations will grow into great beings, we must make sure that the gene pool consists of the best genes. In order to do that, we must compare genes from each other and find out which one is the best!   Instructions: In the code editor, you are provided with a main() function that asks the user for 4 integer inputs and passes these to the getBest() function call. Your task is to declare and define this getBest() function which has the following details: Return type - int Name - getBest Parameters - 4 integers Description - returns the highest integer passed DO NOT EDIT ANYTHING IN THE MAIN Input 1. First integer 2. Second integer 3. Third integer 4. Fourth integer

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

(C PROGRAMMING ONLY)

5. Preserving the Gene Pool
by CodeChum Admin

In order to make sure that the future generations will grow into great beings, we must make sure that the gene pool consists of the best genes. In order to do that, we must compare genes from each other and find out which one is the best!

 

Instructions:

In the code editor, you are provided with a main() function that asks the user for 4 integer inputs and passes these to the getBest() function call.
Your task is to declare and define this getBest() function which has the following details:
Return type - int
Name - getBest
Parameters - 4 integers
Description - returns the highest integer passed
DO NOT EDIT ANYTHING IN THE MAIN
Input

1. First integer

2. Second integer

3. Third integer

4. Fourth integer

Output

Enter a: 10
Enter b: 3
Enter c: 15
Enter d: 14
Highest integer = 15

main.c
< > + c
1 #include<stdio.h>
int main(void) {
int a, b, c, d;
3
4
printf("Enter a: ");
scanf("%d", &a);
6.
7
8
printf("Enter b: ");
scanf("%d", &b);
9.
10
11
printf("Enter c: ");
scanf("%d", &c);
12
13
14
printf("Enter d: ");
scanf("%d", &d);
15
16
17
18
int highest
getBest(a, b, c, d);
19
20
printf("Highest integer
= %d", highest);
21
22
return 0;
Transcribed Image Text:main.c < > + c 1 #include<stdio.h> int main(void) { int a, b, c, d; 3 4 printf("Enter a: "); scanf("%d", &a); 6. 7 8 printf("Enter b: "); scanf("%d", &b); 9. 10 11 printf("Enter c: "); scanf("%d", &c); 12 13 14 printf("Enter d: "); scanf("%d", &d); 15 16 17 18 int highest getBest(a, b, c, d); 19 20 printf("Highest integer = %d", highest); 21 22 return 0;
2. Second integer
3. Third integer
4. Fourth integer
Output
Enter a: 10
Enter b: 3
Enter c: 15
Enter d: 14
Highest integer = 15
Transcribed Image Text:2. Second integer 3. Third integer 4. Fourth integer Output Enter a: 10 Enter b: 3 Enter c: 15 Enter d: 14 Highest integer = 15
Expert Solution
steps

Step by step

Solved in 3 steps with 1 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