0
Setw(4)
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 ....
0
thanks
0
welcome sir ..



