Formatted Console IO Operations

C++ supports a number of features that could be used for formatting the output. These features include: ios class functions and flags. Manipulators. User-defined output functions. 1. ios Class functions and flags The ios class contains a large number of member functions that could be used to format the output in a number of ways. The most important ones among them are listed below. Function Syntax Use width() cout.width(size); To specify the required field size for displaying an output value. precision() cout.precision(2); To specify the number of digits to be…

Read More