Variables and Data Types - C
Variables and Data Types - C
Q. What is a Variable?
In Simple Language: -
A variable is a Container that stores a value that value can be any type like characters, decimal numbers,
floating numbers etc. And these values can be changed during the execution of the program.
Example:
int var_name = 5 ;
➢ Initialization means assigning a value after declaration of variable as example in Ex. 1.1.
Data types simply refers to the type and size of data associated with variables.
OR
A data type specifies the type of data that a variable can store such as integer, floating, character etc. Data
types in C.
DATA TYPES IN C: -
➢ Basic Data Types: int, char, float, double
➢ Derived Data Types: array, pointer, structures, union
➢ Enumeration data Type: enum
➢ Void Data Type: void (means Empty)
By Aditya Shahi
2
float 4 bytes %f
By Aditya Shahi
3
By Aditya Shahi