Generating cleanly formatted output is a common programming requirement. Formatting improves your user interface and makes it easier to read any debugging messages that you might output to the screen. In C++, the I/O formatting can be performed by either manipulators or using the methods of I/O classes and format-state flags (a detailed overview can be found here). We will use manipulators in these notes.A manipulator is a function that can alter the characteristics of the output (and input) stream. For cout, we have seen the endl manipulator which ends a line (and calls the flush function of the ostream).Using cout to Format OutputThe following manipulators, defined in the header file <iomanip>, are the most commonly used for formatting output. setw(n) : sets the minimum width of the next output. The length of the width is n. setfill(c) : fills leading spaces in a number with a given character c. setprecision(n) : sets the maximum number of digits (given by n) that are displayed for a number. fixed : allows inserting floating-point values in fixed format scientific : allows inserting floating-point values in scientific format left : left-justify right : right-justify dec : insert or extract integer values in decimal format oct : insert or extract values in octal (base 8) format hex : insert or extract integer values in hexadecimal (base 16) format For example, the following program section int i = 1299; float f = 314.15926; cout << "numbers:" << setw(10) << i << f << "four" << endl;will output 1 2 312345678901234567890123456789012345numbers: 1299314.159fourThe first two lines are not part of the output, they are just for gauging the output. After outputting "numbers:", setw(10) creates a 10-column empty field and then the number 1299 is placed in this field right-justified. This is followed by "314.159four". Note that 314.15926 is output as "314.159" because of the default format of the compiler.For the following assignment of variables int i = 1453; float f = 314.15926; string s = "University of Gaziantep";Using cin to Format Inputcin, being responsible for input, is a class defined in <iostream>. The extraction operator (>>) is used to put data into your program's variables. For example, the following operation int var; cin >> var;writes data from the buffer of cin to your local variable, var.cin has some member functions to manipulate input data. The famous one is get() that is used to get a single character, including a white space, or a string for input. For example, the following program section char a, b, c; cout << "Enter three letters: "; cin.get(a).get(b).get(c); cout << a << " " << b << " " << c;will output Enter three letters: one o n eHere is the another usage char str1[256], str2[256]; cout << "Enter string one: "; cin.get(str1, 256); cout << "string one: " << str1 << endl; cout << "Enter string two: "; cin >> str2; cout << "string two: " << str2 << endl;an example I/O is Enter string one: Now is the time string one: Now is the time Enter string two: Now is the time string two: NowIn the second input str2 is assigned a string from a space-delimited input so only the first word is stored.Note that the getline() function can be used to input a whole line into a string: string s; cout << "Input your message: "; getline(cin, s);