My test fails please check the code

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

}

hello @raoanky2001

check now->

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.