c++ print variable type code example
Example 1: c++ print variable
cout << x;
cout << "X is: " << x << endl;
//endl is to end the line
Example 2: print data type of a variable in c++
int x = 5;
typeid(x).name();
//output: i
// i stands for int
cout << x;
cout << "X is: " << x << endl;
//endl is to end the line
int x = 5;
typeid(x).name();
//output: i
// i stands for int