Long Data Type In C++

Card image cap

Long Data Type ?

Long data is a 64-bit signed two's complement integer.


The minimum value is -9,223,372,036,854,775,808 and maximum value is 9,223,372,036,854,775,807(inclusive)

This type is used when a wider range than int is needed.

Example:
long a= 100000L, int b= 3200000L

Long is a data type used in programming languages, such as Java, C++, and C#. A constant or variable defined as long can store a single 64-bit signed integer.


Card image cap

Example 1:



Output :

    char   1
    bool   1
    short  2
    int    4
    long   4
    float  4
    double 8
    Press any key to continue . . .
Card image cap

Example 2:



Output :

    In Function f
    localX is 1
    In Function f
    localX is 1
    Press any key to continue . . .

Example 3:



Output :

  
  aimtocode.com

Card image cap