How to set binary value to int variable in C++

1 Answer

0 votes
#include <iostream>

int main(void)
{
    int bin = 0b11111;
 
    std::cout << bin;
}
 
 
 
 
 
/*
run:
 
31
 
*/

 



answered Aug 1, 2022 by avibootz

Related questions

1 answer 240 views
240 views asked Jul 31, 2022 by avibootz
1 answer 242 views
1 answer 209 views
1 answer 267 views
1 answer 273 views
1 answer 270 views
1 answer 211 views
...