Posts

Showing posts from April, 2024

C Data Types

Image
 Each variable in C has an associated data type.  It specifies the type of data that the variable can store like integer, character, floating, double, etc.  Each data type requires different amounts of memory and has some specific operations which can be performed over it.  The data type is a collection of data with values having fixed values, meaning as well as its characteristics. The data types in C can be classified as follows:   Integer Data Type The integer datatype in C is used to store the integer numbers(any number including positive, negative and zero without decimal part). Octal values, hexadecimal values, and decimal values can be stored in int data type in C.  Range:  -2,147,483,648 to 2,147,483,647 Size: 4 bytes Format Specifier: %d Syntax of Integer We use int keyword to declare the integer variable: int var_name; The integer data type can also be used as unsigned int : Unsigned int data type in C is used to store the data values from zero to positive numbers but it can’