sir i have written the body but i dont kno how to write the code to get the desired o/p lines.
plz check the program .
plz helpme out .
This is my code.
#include
using namespace std;
int main(){
int n;
cin >> n;
int a[1000];
for(int i=0;i<n;i++){
cin >> a[i];
}
int b[100];
for(int i=0;i<n;i++){
int sum = 0;
int p = 1;
int r;
int j = 0;
while(a[i] > 0 ){
r = a[i]%10 ;
sum += r*p;
b[j] = sum;
a[i] = a[i]/10;
p *= 2;
j++;
}
}
}
return 0;
}