Jump to content
xisto Community

ssv

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. I am new to this forum. I was hanging around this c,c++ section for a while and found this question pretty interesting.i have a code sample which i feel can do what is expected.bugs and comments are welcomeint fun1(int num1 ,int num2){int temp1 ,temp2;//if(num1 < num2)//return 1//else//return 0if(num1 >> 31){ if(!(num2 >> 31)) return 1; temp1 = ~(num1 + 0xFFFFFF); temp2 = ~(num2 + 0xFFFFFF); if((~temp2) & temp1) return 1; else return 0;}if((~num1) & num2)return 1;elsereturn 0;}hope this code work for all possible valuesbyessv
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.