Make a program that will compare two values without using relational operators in purely c++ syntax.
I know the answer... Just a quiz.... :-)
Printable View
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. :)
:-)
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...
@Salem: I think one should handle errors before everything...
So, that's what everyone does....