Using Hexadecimal Values literals and use cout to print them to the console. - C++ Operator

C++ examples for Operator:Logical Operator

Description

Using Hexadecimal Values literals and use cout to print them to the console.

Demo Code

#include <iostream>

using namespace std;

int main(int argc, char* argv[])
{
    int hexValue{ 0x89 };
    cout << "Decimal: " << hexValue << endl;
    cout << hex << "Hexadecimal: " << hexValue << endl;
    cout << showbase << hex << "Hexadecimal (with base): " << hexValue << endl;

    return 0;//from   w  ww .  java  2  s.c  om
}

Related Tutorials