fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. cout << 0x10 <<endl; // 0x.. number, hexadecimal -> 1 x 16^1 + 0 x 16^0 = 16
  6. cout << 0b10 <<endl; // 0b.. number, binary -> 1 x 2^1 + 0 x 2^0 = 2
  7. cout << 010 <<endl; // 0.. number, octal -> 1 x 8^1 + 0 x 8^0 = 8
  8. cout << 10 <<endl; // decimal number -> 1 x 10^1 + 0 x 10^0 = 10
  9. return 0;
  10. }
Success #stdin #stdout 0s 5636KB
stdin
Standard input is empty
stdout
16
2
8
10