+ 1

How to use the binary numbers in a c++ program

22nd Jan 2017, 1:04 PM
Chethan Shenoy
Chethan Shenoy - avatar
2 Antworten
+ 1
first you have to create the variables. it most be int type: int b,h; then you can assign its value. in this example I created two variables, b for binary and h for hexadecimal: b=0b10; h=0x10; if you print it: cout<<b<<endl; cout<<h<<endl; the result: 2 16 remember 10 on binary is 2 on decimal. and 10 on hexa is 16 on decimal.
22nd Jan 2017, 3:09 PM
Jairo Reyes
Jairo Reyes - avatar
0
ok
22nd Jan 2017, 1:04 PM
Chethan Shenoy
Chethan Shenoy - avatar