- Program :
using namespace std;
int main() {
cout <<"\n----------------DATA TYPES----------------\n";
// Creating variables
int a = 5;
float b = 5.99;
double c = 9.98;
char d = 'D';
bool e = true;
string f = "Hello";
// Print variable values
cout << "int: " << a << "\n";
cout << "float: " << b << "\n";
cout << "double: " << c << "\n";
cout << "char: " << d << "\n";
cout << "bool: " << e << "\n";
cout << "string: " << f << "\n";
return 0;
}
- Output :
No comments:
Post a Comment