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:
Input
1. First integer
2. Second integer
3. Third integer
4. Fourth integer
#include <stdio.h>
int getBest(int a,int b,int c,int d){
int highest=a;
if(b>highest){
highest=b;
}
if(c>highest){
highest=c;
}
if(d>highest){
highest=d;
}
return highest;
}
int main(){
int number1,number2,number3,number4;
printf("Enter the first number: ");
scanf("%d",&number1);
printf("Enter the second number: ");
scanf("%d",&number2);
printf("Enter the third number: ");
scanf("%d",&number3);
printf("Enter the fourth number: ");
scanf("%d",&number4);
printf("Highest integer = %d\n\n",getBest(number1,number2,number3,number4));
getchar();
getchar();
return 0;
}
Comments
Leave a comment