I am getting error with my code

#include
using namespace std;
int main(){
int tc;
cin>>tc;
while(tc–){
int a,b;
cin>>a>>b;
int ans = 0;
for(int i=a; i<=b; i++){
while(i){
ans+=(i & 1);
i = i>>1;
//ans+=__builtin_popcount(i);
}
}
cout<<ans<<endl;
}
}

Hello @Mr_Sidd i have corrected your code and cmmneted the error.


you can check the updated code here .
Happy Learning!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.