Variables and Data Types in C

//variables in C
//variable: A name given to a memory location is called variable
//declaring variable: type variable_name;

//rules for defining a variable in C
    /*1. can contain alphabets, digits and underscore(_)
      2. a variable name can start with an alphabet and underscore only
      3. can't start with a digit
      4. whie space and reserved words are not allowed to give name of a variable  
    */

//Data types in C
    /*1. basic data type: int, char, float, double
      2. derived data type: this type of data types are created or derived by using basic data types
                            array, pointers, structure, union
      3. enumeration data type: emum
      4. void data type: void
    */

#include <stdio.h>
int main()
{
    printf("%lu", sizeof(int));
    return 0;
}

Comments

Popular posts from this blog

Tokens in C

Steps taken by a compiler to execute a C program