Make a program that will compare two values without using relational operators in purely c++ syntax.
I know the answer... Just a quiz.... :-)
Make a program that will compare two values without using relational operators in purely c++ syntax.
I know the answer... Just a quiz.... :-)
I think everybody knows that.
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
:-)
Me either think like this, but if someone doesn't know, it'll be much better for him to learn this thing.....
Everyone, don't post the logic until you didn't find anyone who don't know the answer....
Like using the word "Challenge" in your title is going to make us magically overlook the fact that you've posted your homework/quiz question here in an attempt to get us to do it for you.
Lol..... Don't worry..... I know the answer already.... And it's not my age to do homeworks like these simple tricks :-)
Anyways, keep it going as it is...
Proof is
suppose x and y are two inputs...
Sorry i just read your reply as my thread was on second page...Code:if(x/y){ cout<<y<<"is greater"<<endl; } else{ cout<<x<<"is greater"<<endl; }
Got it.. :-)
Smooth - I input y = 0
Your move...
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.
@Salem: I think one should handle errors before everything...
So, that's what everyone does....