Well, from what I can see you have a basic logic issue that probably comes from a series of typos.
Here is your code (note problems in red):
Code:
/* Find the largest number *'
if (input_1 >= input_2 && input_1 >= input_3) {
high_value = input_2;
}
else if (input_2 >= input_2 && input_2 >= input_3) {
high_value = input_2;
}
else if (input_3 >= input_1 && input_3 >= input_2) {
high_value = input_3;
}
This is what the code was probably meant to be (note changes in green):
Code:
/* Find the largest number *'
if (input_1 >= input_2 && input_1 >= input_3) {
high_value = input_1;
}
else if (input_2 >= input_1 && input_2 >= input_3) {
high_value = input_2;
}
else if (input_3 >= input_1 && input_3 >= input_2) {
high_value = input_3;
}
Now, its worth noting that there is a more efficient way to find the highest if you think about it logically.
Code:
/* Find the largest number *'
high_value = input_1;
if (input_2 >= high_value) {
high_value = input_2;
}
if (input_3 >= high_value) {
high_value = input_3;
}
But that is not really important because your method should work just fine if the mistypes are corrected.
__________________
Branden Ghena - Michigan Tech Student and Team 240 Alumnus
Working Towards: Electrical Engineering and Computer Engineering Double Major
"All we have to decide is what to do with the time that is given to us." - Gandalf