-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path06_variable_01.cpp
37 lines (31 loc) · 943 Bytes
/
06_variable_01.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
//#include <string>
//#include <vector>
using namespace std;
int main(){
string text =
"int - stores integers (whole numbers), without decimals, such as 123 or -123\n"
"double - stores floating point numbers, with decimals, such as 19.99 or -19.99\n"
"char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes\n"
"string - stores text, such as 'Hello World'. String values are surrounded by double quotes\n"
"bool - stores values with two states: true or false";
cout << text << endl;
//
// cout << "\n --- now you can define any variable ---" << endl;
//
// int num = 15;
// // num = 19 ;
// cout << num << endl;
//
// double my_dbl = 5.47;
// cout << my_dbl << endl;
//
// char character = 'f';
// cout << character << endl;
//
// bool res_true = true;
// bool res_false = false;
// cout << res_true << endl;
// cout << res_false << endl;
return 0;
}