-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants_manipulators_operator_precedence.cpp
More file actions
39 lines (31 loc) · 1.18 KB
/
constants_manipulators_operator_precedence.cpp
File metadata and controls
39 lines (31 loc) · 1.18 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
// #include <iostream>
// #include <iomanip>
// using namespace std;
// int main()
// {
// // *******concept of constant******
// int a=5;
// cout<<"The value of a is:"<<a<<endl;
// a=6;
// cout<<"The value of a is:"<<a<<endl;
// return 0;
// //here we can see that the value of a is changes
// //but when we want that the value of a is not changes then
// //we have to use the syntax [const int(data type) a(variable)=value]
// const int a=5;
// cout<<"The value of a is:"<<a<<endl;
// a=6;/*at this point it shows error because we can only read the value of a */
// cout<<"The value of a is:"<<a<<endl;
// // *****manipulators*****
// // the (endl) is also manipulator
// // (setw) used as follow
// // int a=3,b=447,c=13848;
// // cout<<"The value of a is:"<<a<<endl;
// // cout<<"The value of b is:"<<b<<endl;
// // cout<<"The value of c is:"<<c<<endl;
// // cout<<"The value of a is:"<<setw(5)<<a<<endl;
// // cout<<"The value of b is:"<<setw(5)<<b<<endl;
// // cout<<"The value of c is:"<<setw(5)<<c<<endl;
// // *******Operator Precedence*****
// // use we reference website of c++
// }