Data Types - Devbhoomi

FREE JOB ALERT & ONLINE TUTORIALS

Hot

Post Top Ad

Sunday 5 November 2017

Data Types

  • DataTypes are used for declaring variables And functions of different types.
  • When Program store data in variables, It is necessary that each variable must be assigned a specific data type.
Following are the list of Data Types in C :
KeywordMemoryRange
char or signed char1 Byte-128 to 127
unsigned char1 Byte0 to 255
int or signed int2 Byte-32,768 - 32,767
unsigned int2 Byte0 to 65535
short int or signed short int1 Byte-128 to 127
unsigned short int1 Byte0 to 255
long or signed long4 Bytes-2,147,483,648 to 2,147,483,647
unsigned long4 Bytes0 to 4,294,967,295
float4 Bytes3.4E - 38 to 3.4E + 38
double8 Byte1.7E - 308 to 1.7E + 308
long double10 Bytes3.4E-4932 to 1.1E + 4932
Declaration of variable :

    main()
    {
    /* declaration */

    //long int is datatype and amount is variable name
    long int amount;

    //int is datatype and code is variable name
    int code;

    char c;

    double average;

    float x,y;

    }

No comments:

Post a Comment

Post Top Ad