Whats wrong in this program why its not giving correct output

#include
using namespace std;
int main() {
long long n,no,x,ans=0;
cin>>n;
int i=0,j,k=1;
while(i!=n)
{ans=0;
cin>>no;
while(no>0)
{
x=no%10;

ans=ans+kx;
k=k
2;
no=no/10;
}
cout<<ans<<’\n’;
i++;}
}