+ 4
How to convert a number in binary to octal using javascript...?
Javascript
7 Answers
+ 4
var binary = "10010100101";
var octal = parseInt(binary, 2).toString(8);
+ 3
const octal = (binary) => {
return parseInt(binary, 2).toString(8);
}
console.log(octal("1010")); // 12
+ 3
Mustafha Ahmad Is this what you mean by full programme? :))
https://code.sololearn.com/WAAOPqq9L1cQ/?ref=app
Just take an input and pass it to the function!
+ 3
Vasiliy Nopes :)) Both of the examples are Alright.
Binary : 1010
Decimal : 10
Octal : 12
+ 3
Arb Rahim Badsa, thanks for the answer, I'm sorry, 2 a.m., brains twisted it's time to sleep đ
0
Can anyone please write full program
0
Thank you