Getting Different output again

#include
using namespace std;
int main() {
int no;
int N;
cin>>N;
while (N>0){
cin>>no;
int p = 1 ;
int ans = 0;
while(no>0){
int r = no%10;
ans = ans+rp;
p=p
2;
no = no/10;
}
cout<<ans<<endl;
N = N - 1;
}
return 0;

}

This is the code and I’m not getting the actual output.kindly help me out

I have edited your code, try to submit now,