1 votes 1 votes What is the following function doing? 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; } Balaji Jegan asked Jul 15, 2018 Balaji Jegan 197 views answer comment Share Follow See 1 comment See all 1 1 comment reply Shaik Masthan commented Jul 16, 2018 reply Follow Share It is calculating a/b 5/2 = 2 6/2 = 3 2 votes 2 votes Please log in or register to add a comment.
0 votes 0 votes Simple program in a complex way. For division . It will return a/b . Tanujsh9639 answered Jul 16, 2018 Tanujsh9639 comment Share Follow See all 0 reply Please log in or register to add a comment.