-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut8.cpp
More file actions
47 lines (41 loc) · 1.21 KB
/
tut8.cpp
File metadata and controls
47 lines (41 loc) · 1.21 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
#include<iostream>
#include<iomanip>
using namespace std;
// int main()
// {
// int a = 5 ;
// cout<<"The value of a was: "<<a<<endl;
// a = 55 ;
// cout<<"The value of a is: "<<a<<endl;
// Constant in C++ are like this
// const int a = 5;
// cout<<"The value of a was: "<<a<<endl;
// a = 55 ;
// cout<<"The value of a is: "<<a<<endl;
// By using constant we can not change the value of a variable
// it shows the error of read only variable you can not change
// return 0 ;
// }
// int main()
// {
// Manipulator in C++
// int a=5 , b = 55 , c = 555 ;
// cout<<"The value without setw is "<<a<<endl;
// cout<<"The value without setw is "<<b<<endl;
// cout<<"The value without setw is "<<c<<endl;
// cout<<"The value with setw is "<<setw(4)<<a<<endl;
// cout<<"The value with setw is "<<setw(4)<<b<<endl;
// cout<<"The value with setw is "<<setw(4)<<c<<endl;
// return 0 ;
// setw adds the space of 4 and right justify the varibales value
// }
// int main()
// {
// // Operator presedence in C++
// int a =3, b=4;
// // int c = (a*5)+b;
// int c = ((((a*5)+b)-45)+87);
// cout<<c;
// return 0;
// return 0 ;
// }