Answer to Question #236113 in C++ for SOM

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.


1
Expert's answer
2021-09-11T23:49:30-0400


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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS