A data type defines what kind of data a variable can hold. Getting the type right is what keeps memory usage, calculations, and output formatting correct.
c
#include <stdio.h>
int main() {
int items = 5;
double distance = 12.7564;
char initial = 'T';
printf("Items: %d
", items);
printf("Distance: %.3lf km
", distance);
printf("Initial: %c", initial);
return 0;
}int holds a whole number, double holds a decimal number with higher precision than float, and char holds a single character.
You should see
Items: 5 Distance: 12.756 km Initial: TInfo
For decimal values where precision matters in calculations, it's better to use double.