Posts

Showing posts from September 18, 2024

Data Types in C

Data types are the type of data stored in a C program. Data types are used while defining a variable or functions in C. It’s important for the compiler to understand the type of predefined data it is going to encounter in the program. In this article, we will discuss Data type in C programming with example. What is Data Type in C? C provides several built-in data types, such as integer (int), character (char), floating-point (float), and double-precision floating-point (double), among others. Each data type has its own set of possible values and operations that can be performed on it. Example Of Data Types In C Let’s consider a scenario of a company. A company stores various data of their employee such as Name, Employee ID, Age, Salary, Address, Phone No, etc. Now, these data are values containing alphabets, numbers, etc, so to make the processing of these huge data for programs easy, the information was categorized into different types: Name: String ID: Integer Salary: Float or Double