I changed the code and now its giving compilation error but it’s working correctly on my system.
here’s the code
#include
#include
using namespace std;
int main()
{long long a,n;
cin>>n;
for(long long k=0;k<n;k++)
{cin>>a;
long long x=a,y=0;
bitset<10> b(a);
long long i=b.size()-1;
while(b[i]!=1)
{i–;}
bitset<50> d;
for(long long p=0,j=i;p<=i;p++,j–)
{d[p]=b[j];}
cout<<d.to_ullong()<<"\n";
}
return 0;
}