Data Types in C || Basic Data Types In C || C Programming Language ||Diferent Types of DataTypes || Tutorial 05

 DataTypes in C

Each variable in C has an associated data type. Each data type requires different amounts of memory and has some specific operations which can be performed over it.

  • Basic Data Types
  • Derived Data Types
  • Enumeration Data Type
  • Void Data Type

Basic Data Types in C


char: The most basic data type in C. It stores a single character and requires a single byte of memory in almost all compilers.
 char a = ‘d’;        %c


int: As the name suggests, an int variable is used to store an integer.
int a = 10;            %d


float: It is used to store decimal numbers (numbers with floating-point values) with single precision.
float a = 5.55;       %f


double: It is used to store decimal numbers (numbers with floating point value) with double precision.Same as float but bigger space to store number 8 bytes
double a = 134.33543;  %f or %lf


0 Comments