Safcode | Code Your Ideas by Sir Safder

  • Data Types & Variable

    Data type mentions the type of data that a variable can store.
    C language supports two type of data types:
    1. Primary data types:
    	These are fundamental data types in C namely integer (int),
    	floating point (float), character(char) and void.
    2. Derived data types:
    	Derived data types are nothing but primary datatypes but a little 
    	twisted or grouped together like array, structure, union and pointers.
    1. Primary data types:
    INT (integer)
    Integer datatype accepts only numeric values. 
    Its size is 4 bytes and its range is -2,147,483,647 to 2,147,483,647.
    Character (char)
    char datatype accept only single alphanumeric value.
    Its size is 1 byte and its range is -128 to 127
    Float datatype accepts numeric and decimal point values.
    Its size is 4 bytes.
    void means no value. This is used to specify the type of functions which
    returns nothing.
    Variable is a name which hold a value. Its value can be changeable, 
    and it can be reused many times.
    * A variable consists of alphabets, digits, and underscore.
    * A variable name always start with alphabet or underscore.
    * No whitespace is allowed within the variable name.
    * A variable name can not be used any reserved word or keyword.
      e.g. int, float, etc.

  • You Can Also Watch Our Tutorial