Numbers after decimal point | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Numbers after decimal point

What is the function for defining the number 0 after decimal point in c++ For example: double a; a=3.000 std::cout << a; // it will print 3 in console. what function should I add to this program to print 3.000

11th Dec 2019, 4:34 PM
Severus
Severus - avatar
1 Answer
+ 1
You need to:- #include <iomanip> cout << showpoint << setprecision(4) << a << endl;
11th Dec 2019, 10:36 PM
rodwynnejones
rodwynnejones - avatar