Use of Stream Manipulators in C++ Programming Language - Use of iomanip in C++ Programming Language

 


Stream Manipulators:

  • The setw() method of iomaip library in C++ is used to set the ios library field width based on the width specified as the parameter to this method.
  • setw(n) sets the minimum width of the input for the next stream operation. 
#include <iomanip>  // for setw() 

Example:

Use of Stream Manipulators in C++ Programming Language - Use of iomanip in C++ Programming Language
 Use of iomanip in C++ Programming Language

Output:

Use of Stream Manipulators in C++ Programming Language - Use of iomanip in C++ Programming Language
Output of iomanip in C++ Programming Language


Post a Comment

0 Comments