A data type defines what kind of data a variable can hold. Choosing the right data type matters for memory usage, calculation accuracy, and how easy your code is to read.
cpp
#include <iostream>
#include <string>
using namespace std;
int main() {
int students = 35;
double averageMark = 82.75;
char section = 'B';
bool passed = true;
string course = "C++ Foundation";
cout << course << endl;
cout << "Students: " << students << endl;
cout << "Average: " << averageMark << endl;
cout << "Section: " << section << endl;
cout << "Passed: " << passed;
return 0;
}int is for whole numbers, double is for decimal numbers, char is for a single character, bool is for true/false, and string is for text. For data that doesn't need decimals, like a student count, int is the better fit.
You should see
C++ Foundation Students: 35 Average: 82.75 Section: B Passed: 1Info
For decimal values like money, grade averages, or measurements, double is used more often than float.