Data Types

 Data Types Introduction 

Data Types in C specify the type of data that a variable can hold. C provides the variety of data types, each designed to handle to different kind of information, such as an integer, floating point numbers, characters and more. Understanding and choosing the appropriate data type for a variable is crucial for efficient memory usage and accurate representation of data.

Common data types in C include:




  • Integer: Int - 'Int' is a data type used to declare variables that can store integer values. It stands for integer and is a fundamental data type for working with whole numbers in C programs.
  • Short Int- Short is a data type used to declare variables that can store short integer values. It is a modifier for the 'Int' data type, and it used when memory conversion is a priority. 
  • Long Int- 'long Int' is a data type used to declare variables that can store long integer values. It is a modifier for the 'Int' data type, providing an extended range for representing large integers.
  • long long int- 'long long Int' is a data type used to declare variables that can store even larger integer values than long. It provided an extended range beyond what long can handle. 
  • Unsigned- Int- 'Unsigned Int' is a data type used to declare variables that can store non negative integer values. It is a modification of the 'Int' data type, indicating that the variable will not store negative value. 
  • Float- Float is a data type used to declare variables that can store single precision floating point number. It is suitable for representing real numbers with a fractional part is a fundamental data type for handling decimal numbers. 
  •  Double- double is a data type used to declare variables that can store double precision floating point number. Double- precision means that these variables can represent decimal values with a higher level of precision compared to the float data type.
  •  Long double- double is a data type used to declare variables that can store extended precision floating point number. It is offers a higher level of precision compared to both float and double data types.
  • Char- In, C char is a data type used to declare variables that can store a single character. It is commonly employed for representing letters, digits, and other individual symbol. 
  •  Unsigned Char- In C, Unsigned char is a data type is used to declare variables that can store single characters, limited to non negative values. It is similar to char data type, but it does not represent negative value. 
  • Signed char- In C, signed char is a data type is a data type used to declare variables that can store single characters and explicitly represent both positive and negative values.
  • _Bool- In C, _Bool is a data type used to declare variables that can store Boolean variables. It is primarily used for representing true or false.

0 Comments