Concise Code C++


#1

unsigned int ans=0;
for(int i=0;i<=31;i++)
{
ans=ans+(((A&(1<<i))?1:0)<<(31-i));
}

return ans;