-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariable.cpp
More file actions
48 lines (36 loc) · 1.23 KB
/
variable.cpp
File metadata and controls
48 lines (36 loc) · 1.23 KB
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
38
39
40
41
42
43
44
45
46
47
48
# include <iostream>
using namespace std;
int main(){
system("clear");
// // 1. Variavble declartion (don't put the value )
// int age;
// float salary;
// string name;
// // 2. Assing value to variable
// age = 25;
// salary = 1000,59;
// name = "Kii";
// // 3. Initialize variable (as put as the value)
// string classname = " C++ Programming ";
// cout << "age: " << age << endl;
// cout << " salary: " << salary << endl;
// cout << " name: " << name << endl;
// cout << " classname: " << classname << endl;
// input and Output Stream
string name; // camelCase(className), snake_case(class_name), PascalCase(ClassName) when we stat in OOP
int age;
string className;
cout << " Enter your age: ";
cin >> age;
cin . ignore(); // ignore the new (\n) line character
cout << " Enter your name: ";
//cin >> name;
getline(cin, name); // get the whole line from keyboard
cout << " Enter your className: ";
cin >> className;
cout << "=====| student Information |===== " << endl;
cout << " MY name is " << name << endl;
cout << " I'm " << age << endl;
cout << " MY className " << className << endl;
return 0;
}