in the lecture videos i haven’t come across finding numbers using binary format …
kindly clarify
Not able to guess the method
hi @sanyamvv33_df49c435732e7baf
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.
refer this code -->
yes sir thankk you so much
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.