0

Setw(4)

17th Dec 2016, 5:06 PM
Amir shakeri
Amir shakeri - avatar
3 Answers
0
Setw(number ) is manipulator specifies width of given number for printing the value of given data example : int i= 324; int j= 12; int t= 1234; int y= 1; cout << "1. "<<setw(4)<< i<<endl; cout << "2. "<<setw(4)<< j<<endl; cout << "3. "<<setw(4)<< t<<endl; cout << "4. "<<setw(4)<< y<<endl; output : just take 4 space for explanation 1. | | 3 | 2| 4 | 2. | | | 1| 2 | 3. | 1 | 2 | 3| 4 | 4. | | | | 1 | The manipulator setw(4) specifies width 4 for printing the value of the variables . hope you understood ....
17th Dec 2016, 5:26 PM
Mock
Mock - avatar
0
thanks
17th Dec 2016, 5:49 PM
Amir shakeri
Amir shakeri - avatar
0
welcome sir ..
17th Dec 2016, 5:52 PM
Mock
Mock - avatar