7.Data Types in C Programming
Explanation of Data Types with Small Code Snippets

What Is a Data Type?
A data type tells the compiler:
The type of data a variable will store
The size of memory required
The range of values the variable can hold

Basic Data Types :
๐น int
- Used to store whole numbers
int number = 10;
printf("%d", number);
๐น char
- Used to store single characters
char grade = 'A';
printf("%c", grade);
๐น float
- Used to store decimal (real) numbers
float temp = 36.5;
printf("%.1f", temp);
๐น double
Used to store large decimal numbers
More precise than float
double average = 89.4567;
printf("%lf", average);
๐น void
Represents no value
Used when no data is required

Example C Program Using Different Data Types




