Hey Guys,
I'm new to programming and am really stumped on how to write a program on figuring out the greates of three integers and could really use someone's help.
Thanks a lot guys!!
Tony
Hey Guys,
I'm new to programming and am really stumped on how to write a program on figuring out the greates of three integers and could really use someone's help.
Thanks a lot guys!!
Tony
I think something like that might work, been a couple years :-pCode:if(x > y && x > z) greatest = x; if(y >x && y > z) greatest = y; if(z > x && z > y) greatest = z;
Hmm
I looked under the tutorials but I'm not too sure what I should be looking for.Originally Posted by kermit
Or you can turn this into your teacher, and get an F:
Code:int returnLargest(int a, int b, int c) { return (((a > b) ? a : b) < c) ? c : ((a > b) ? a : b); }
I LOVE YOU!!!!!!!Originally Posted by B0bDole
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
I LOVE YOU!!!!!!!
What does greatest equal if x = 5, y = 5, and z = 4?Originally Posted by B0bDole
definetly that's not the best way to do it...
instead just try with a few 'if-else' statements,it would be more clear and easy to follow...
>What does greatest equal if x = 5, y = 5, and z = 4?
I'm not trying to get him an A or anything :-p
Hmm
> I'm not trying to get him an A or anything
A today
F tomorrow
It all balances out in the end.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.