adunb8
  • adunb8
what is setw( ) and setprecision () and how do i use them?
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
walters
  • walters
setw() under iomanip use to make space by simply writing the value inside the parentheses setpreecision=it set a number of digits after a comma (it is also under iomanip)
adunb8
  • adunb8
here is my code : #include #include #include using namespace std; int main() { float a= 3.0, b= 5.0, c = 7.1, d=8.3, e=2.2, f=3.2 , g= 6.1, product ; int h=5 ; cout << " " << setprecision(2) << a << endl; cout << "*" << setprecision(2) << b << endl; cout << "----------" << endl; product = a*b ; cout << product << endl; system ("pause") ; }
adunb8
  • adunb8
however the setprecision is not working

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

walters
  • walters
#include #include #include using namespace std; int main() { float product ;//your type must b type float float a= 3.0, b= 5.0, c = 7.1, d=8.3, e=2.2, f=3.2 , g= 6.1; int h=5 ;//wat is the use of c,d,e,f,g,h cout << " " << a <
walters
  • walters
hey gotta sleep bye-bye
nincompoop
  • nincompoop
http://www.cplusplus.com/reference/iomanip/setprecision/
adunb8
  • adunb8
tnx!

Looking for something else?

Not the answer you are looking for? Search for more explanations.