c 2b 2b base 10 to base 2

Solutions on MaxInterview for c 2b 2b base 10 to base 2 by the best coders in the world

showing results for - "c 2b 2b base 10 to base 2"
Alberto
11 Jun 2017
1void show_binary( int dec )
2{
3    std::cout << "decimal = " << dec << "\n";
4    
5    std::string bin{};
6    
7    while( dec > 0 ) {
8        if( dec % 2 == 0 ) bin.insert( bin.begin( ), '0' );
9        else bin.insert( bin.begin( ), '1' );
10        
11        dec >>= 1;
12    }
13    
14    std::cout << "binary = " << bin << "\n";
15}
queries leading to this page
convert base 2 number to base 6 c 2b 2bbase 2 to base 10 code c 2b 2bconvert base 2 to base 10 c 2b 2bbase 10 to another base c 2b 2bconvert base 10 to base 2 c 2b 2bbase 2 to base 6 c 2b 2bbase 2 decimal to base 10 c 2bgiven a number in base 2 convert into base 10 c 2b 2bgiven a number in base 2 convert into base 6 c 2b 2bturn number into base 2 c 2b 2bfrom base 8 to base 10 c 2b 2bbase 10 to base 4 c 2b 2bconvert a base 2 number to base 6 c 2b 2bconvert base 2 to base 6 c 2b 2b codebase 10 to base 2 algorithm in c 2b 2bconvert 22base 2 to base 10 22 c 2b 2bbase 2 to base 6 conversion c 2b 2bfrom base 6 to base 10 c 2b 2bconverting base 10 integer to base 2 in c 2b 2bconvert base 2 to base 10 in c 2b 2bc 2b 2b base 10 to base 3c 2b 2b ode to convert a base 2 number to base 6c 2b 2b base 10 to base 2how to convert base 10 number to base 2 in c 2b 2bbase 10 to base 6 c 2b 2bconvert base 10 to base 4 in c 2b 2bprogramming a base 2 converterconvert base 6 to base 2 c 2b 2bbase of 2 to base of 10 c 2b 2bhow to convert base 10 to base 4 in c 2b 2bbase 10 to base 2 c 40 codebase 2 to base 6 cppbase 2 c 2b 2bc 2b 2b base 10 to base 2 built inbase 2 to 6 c 2b 2bbase 10 to base 8 cppgiven a number in base 2 convert it into base 6 cppcpp base 10 to base 2c 2b 2b funcion 10 to base 2 codec 2b 2b base 2 to base 10base 10 to base 2 c 2b 2bconvert base 2 to base 6 c 2b 2bconverting base 10 to base 2 in cconvert base 2 to base 3 c 2b 2b codec 2b 2b base 2base 2 decimal to base 10 c 2b 2bconvert a number in base 2 to base 6 c 2b 2bhow to convert base 2 to base 10 c 2b 2bconvert base 10 to base 2 code c 2b 2bconvert to base 2 in c 2b 2bc 2b 2b base 10 to base 2