Java script for Decimal to Binary:
Code:
x = 75 ; // x is the decimal number
y = “” ; // y is the binary equivalent
while ( x > 0) {
remainder = x % 2 ;
quotient = Math.floor( x / 2 ) ;
y = remainder + y ;
x = quotient ;
}
document.write(“y = ” + y) ;
how could i do in C++ with displays its binary number equivalent in 12 bits on the screen in the c++