main.c + c 6. Preserving the Gene Pool 1 #includestdio.h> by CodeChum Admin 2 3- int main(void) { 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! 4 int a, b, c, d; printf("Enter a: "); scanf("%d", &a); 6 8. Instructions: printf("Enter b: "); scanf("%d", &b); 9. 1. In the code editor, you are provided with a main() function that asks the user for 4 10 11 integer inputs and passes these to the getBest() function call. 2. Your task is to declare and define this getBest() function which has the following printf("Enter c: "); scanf("%d", &c); 12 13 details: 14 1. Return type - int printf("Enter d: "); scanf("%d", &d); 15 2. Name - getBest 16 17 3. Parameters - 4 integers 4. Description - returns the highest integer passed int highest = getBest(a, b, c, d); 18 19 3. DO NOT EDIT ANYTHING IN THE MAIN printf("Highest integer = %d", highest); 20 21 22 return 0; Input 23 1. First integer 2. Second inteaer

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 3PE
icon
Related questions
Question

Hello! Please help me find the C language code of this. Thank You!

O Answer Task
+
->
A app.codechum.com/student/answer/43403/question/6
E Back to Home
Time Left: 57:05
Overall Score: 0/70
Current Rank: A
Layout:
Side-by-Side
v Saved
main.c
+
Te:
6. Preserving the Gene Pool
Cas
1 #include<stdio.h>
by CodeChum Admin
2
3- int main(void) {
int a, b, c, d;
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!
4
printf("Enter a: ");
scanf("%d", &a);
6.
7
8
Instructions:
printf("Enter b: ");
scanf("%d", &b);
9.
10
1. In the code editor, you are provided with a main() function that asks the user for 4
11
integer inputs and passes these to the getBest() function call.
2. Your task is to declare and define this getBest() function which has the following
printf("Enter c: ");
scanf("%d", &c);
12
13
details:
14
1. Return type - int
printf("Enter d: ");
scanf("%d", &d);
15
16
2. Name - getBest
3. Parameters - 4 integers
17
18
int highest = getBest(a, b, c, d);
4. Description - returns the highest integer passed
19
3. DO NOT EDIT ANYTHING IN THE MAIN
20
printf("Highest integer = %d", highest);
21
22
return 0;
Input
23
1. First integer
2. Second integer
Score: 0/10
= Overview
6/7
Execute Code [F10]
Submit Code
ENG
4:11 pm
US
16/02/2022
...
Transcribed Image Text:O Answer Task + -> A app.codechum.com/student/answer/43403/question/6 E Back to Home Time Left: 57:05 Overall Score: 0/70 Current Rank: A Layout: Side-by-Side v Saved main.c + Te: 6. Preserving the Gene Pool Cas 1 #include<stdio.h> by CodeChum Admin 2 3- int main(void) { int a, b, c, d; 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! 4 printf("Enter a: "); scanf("%d", &a); 6. 7 8 Instructions: printf("Enter b: "); scanf("%d", &b); 9. 10 1. In the code editor, you are provided with a main() function that asks the user for 4 11 integer inputs and passes these to the getBest() function call. 2. Your task is to declare and define this getBest() function which has the following printf("Enter c: "); scanf("%d", &c); 12 13 details: 14 1. Return type - int printf("Enter d: "); scanf("%d", &d); 15 16 2. Name - getBest 3. Parameters - 4 integers 17 18 int highest = getBest(a, b, c, d); 4. Description - returns the highest integer passed 19 3. DO NOT EDIT ANYTHING IN THE MAIN 20 printf("Highest integer = %d", highest); 21 22 return 0; Input 23 1. First integer 2. Second integer Score: 0/10 = Overview 6/7 Execute Code [F10] Submit Code ENG 4:11 pm US 16/02/2022 ...
O Answer Task
+
->
A app.codechum.com/student/answer/43403/question/6
E Back to Home
Time Left: 57:00
Overall Score: 0/70
Current Rank: A
Layout:
Side-by-Side
v Saved
2. Name - getBest
main.c
+
Te:
3. Parameters - 4 integers
Cas
4. Description - returns the highest integer passed
1 #include<stdio.h>
3. DO NOT EDIT ANYTHING IN THE MAIN
2
3- int main(void) {
int a, b, c, d;
4
Input
printf("Enter a: ");
scanf("%d", &a);
6.
7
1. First integer
8
printf("Enter b: ");
scanf("%d", &b);
2. Second integer
9.
10
3. Third integer
11
printf("Enter c: ");
scanf("%d", &c);
12
4. Fourth integer
13
14
printf("Enter d: ");
scanf("%d", &d);
15
Output
16
17
18
int highest = getBest(a, b, c, d);
Enter a: 10
19
Enter b: 3
20
printf("Highest integer = %d", highest);
Enter c: 15
21
Enter d: 14
22
return 0;
23
Highest integer = 15
Score: 0/10
= Overview
6/7
Execute Code [F10]
Submit Code
4:12 pm
16/02/2022
ENG
US
...
Transcribed Image Text:O Answer Task + -> A app.codechum.com/student/answer/43403/question/6 E Back to Home Time Left: 57:00 Overall Score: 0/70 Current Rank: A Layout: Side-by-Side v Saved 2. Name - getBest main.c + Te: 3. Parameters - 4 integers Cas 4. Description - returns the highest integer passed 1 #include<stdio.h> 3. DO NOT EDIT ANYTHING IN THE MAIN 2 3- int main(void) { int a, b, c, d; 4 Input printf("Enter a: "); scanf("%d", &a); 6. 7 1. First integer 8 printf("Enter b: "); scanf("%d", &b); 2. Second integer 9. 10 3. Third integer 11 printf("Enter c: "); scanf("%d", &c); 12 4. Fourth integer 13 14 printf("Enter d: "); scanf("%d", &d); 15 Output 16 17 18 int highest = getBest(a, b, c, d); Enter a: 10 19 Enter b: 3 20 printf("Highest integer = %d", highest); Enter c: 15 21 Enter d: 14 22 return 0; 23 Highest integer = 15 Score: 0/10 = Overview 6/7 Execute Code [F10] Submit Code 4:12 pm 16/02/2022 ENG US ...
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning