Sample program

The C++ program shown in Listing 1 illustrates various data types.

Variables of several different types are declared, initialized, and displayed.

The program displays the following output on the screen:

numCharVar= ≥
shortVar=   32767
intVar=     2147483647
longVar=    2147483647
overflow=   -2147483648
charVar=    F
wideChVar=  66
floatVar=   6.66667
doubleVar=  66.6667
longDblVar= 666.667
boolVar=    1
boolVar*2=  2
stringVar=  Hello World
Press any key to continue