Fundamental concepts

can we do this question without array?
pls reply

@pdhankhar_61
yes ,
for binary number fedcba , Decimal number = f.2^5 + e.2^4 + d.2^3 + ……+ a.2^0.

The idea is to extract the digits of given binary number starting from right most digit and keep a variable decvalue.
At the time of extracting digits from the binary number, multiply the digit with the proper base (Power of 2)
and add it to the variable dec_value.
At the end, the variable decvalue will store the required decimal number.

i am able to convert it from binary to decimal but the way as output has been displayed i am not able to do that thing.

@pdhankhar_61
suppose ans is your decimal conversion so you just need print the ans
System.out.println(ans) and in the next iteration change the value of ans equal to zero again.

if you still unable to do it send me your code

Thanks I will check it.

@pdhankhar_61
please mark your doubt as resolved and rate my work.

Sorry , I think that this question can’t be solved by only fundamental concepts because we will need of array.