I am getting the WA for multiple test cases

Here is my code -
#include <bits/stdc++.h>
using namespace std;

int setbit(int no , int nt){
int fans = 0 , i;
for( i = no ; i<= nt ;i++){
int ans = 0;
int nu = i;
while(nu>0){
ans += (nu&1);
nu >>= 1;
}
fans += ans ;
}
return fans;
}

int main() {
int t;
cin >>t;

   while(t--){
       int a,b;
       cin>>a>>b;
         int l = setbit(a,b);
       cout<<l<<"\n";
   }
 
return 0;

}

Hello @StreamerX,

But there is only one test case in this problem and your code is executing correctly.
Please, check it again.

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.