731 views
0 0 votes
unsigned fun(unsigned a, unsigned b)
{
    int i;
    unsigned j = 0;
    for(i = 0; i < 32; i++)
    {
        j <<= 1;
        j += !!(a & 0x80000000);
        a <<= 1;
        if(j >=b)
        {
            j -= b;
            a++;
        }
    }
    return a;
}

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
0 0 answers
591
591 views
Desert_Warrior asked May 16, 2016
591 views
unsigned fun(unsigned int a) { unsigned int i, x = 0, y = 0, z = 0; for(i = 0; i < 16; i++) { y <<= 2; y += !!(a & 0x80000000) << 1; y += !!(a & 0x40000000); a <<= 2; x =...
2 2 votes
3 3 answers
2.2k
2.2k views
Laahithyaa VS asked Sep 9, 2023
2,176 views
. What will be the value returned by the following function, when it is called with 11?recur (int num){if ((num / 2)! = 0 ) return (recur (num/2) *10+num%2);else return 1...
4 4 votes
2 answers 2 answers
3.2k
3.2k views
Gangani_Son asked Dec 14, 2018
3,160 views
What is the return value of following function for 484? What does it to in general?bool fun(int n){ int sum = 0; for (int odd = 1; n sum; odd = odd+2) sum = ...
1 1 vote
2 2 answers
1.2k
1.2k views
Desert_Warrior asked May 16, 2016
1,184 views
int foo( int a, int b) { int c = a-b; c = c&(0x80000000); return (!c)*a +(!!c)*b; }