Concept(Not getting the desired answer)

I am getting the sum of all the answers that are converted into decimal from binary instead of individual decimal forms of corresponding binary forms.

to handle multiple testCases use this template

int t;cin>>t;
    while(t--){
   // write your code for each testcase here
    }

Modified Code

May I send you my code?

#include using namespace std; int main() { int n; //No. of binary numbers cin>>n; int ch[n]; for(int i=0;i<n;i++){ int dec = 0; int no; cin>>no; int p = 0; while(no>0){ int ones_digit = no%10; dec =dec+(ones_digit<<p); p = p+1; no = no/10; } } cout<<dec<<endl; return 0;

Your modified code is giving the same answer as mine.

my code is different from you
check once
you are not handling multiple input

but it is giving the output in the same way as mine. Output is correct but the way is not same as the asked.

It should take inputs at first and after taking all the inputs it should give the outputs on separate lines

I have submitted and succeeded. Will it show any message or tick sign after the title??

tick will be shown in your your online course
like this
image

I have submitted the code and it is showing “Success” as compile message but no tick is appearing my course.

If we unlock an editorial for a question…,

have you unlock the editorial before submitting??

do the tick appears??

No
if you unlock editorial or testcases then tick will not appear

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.