Question #236113

What are manipulators? Write a cout statement using manipulator to print a float number right justified in the width of 10 columns with precision of 2 digits.


Expert's answer


Manipulators are helping functions that can modify the input or the output stream.



#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
	cout<<"*"<<setw(10)<<setprecision(2)<<2.5782<<"*";


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS