Whats wrong in my code for below q

Prateek Bhayia likes to play with bits. One day Prateek bhayia decides to assign a task to his student Sanya. You have help Sanya to complete this task. Task is as follows - Prateek Bhayia gives Q queries each query containing two integers a and b. Your task is to count the no of set-bits in for all numbers between a and b (both inclusive)
Input Format

Read Q - No of Queries, Followed by Q lines containing 2 integers a and b.
Constraints

Q,a,b are integers.
Output Format

Q lines, each containing an output for your query.
Sample Input

2
1 1
10 15

Sample Output

1
17
#code

int main() {
int t,r,s,sum=0,sc;
cin>>t;
while(t–){
cin>>r>>s;
if(r==s){
cout<<__builtin_popcount®<<endl;;
}
else{
for(int i=r;i<=s;i++){

	   sc = __builtin_popcount(i);
	   sum+= sc;
       
   }
   cout<<sum<<endl;
   }
}
return 0;

}

Hey @Kash-Moulik-3715574511847721 share your code using ide.codingblocks.com so that I can let you know your mistake.
Also tell me the name of the problem as I can’t get link for this problem.

Name of the problem?

playing with bits is the name

Have debugged your code here and also have added comment to point your mistake. Now it’s giving 100% result

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.