Von neuman loves binary

#include
#include<math.h>
using namespace std;
int main() {
int n;
cin>>n;
long long b;
while((n–))>0)
{
cin>>b;
int p=0;
long long d=0;
while(b>0)
{
d+=(b%10)*pow(2,p);
p+=1;
b/=10;
}
cout<<d<<endl;
}
return 0;
}

program is not running for this code.
no output is coming.
even errors are not coming if any.

Hi @yutikakhanna
Error is in line while((n–))>0) you do not have to compare n-- with 0 because when you do while(n–) then loop will automatically stop when n=0. So just change while((n–))>0) to while(n–) then all your test cases will pass.

Here is your corrected code :

Summary

This text will be hidden