c 2b 2b cout format specifier for correct number of decimal points

Solutions on MaxInterview for c 2b 2b cout format specifier for correct number of decimal points by the best coders in the world

showing results for - "c 2b 2b cout format specifier for correct number of decimal points"
Albany
11 Jul 2016
1#include <iostream>
2#include <iomanip>
3
4int main()
5{
6    double d = 122.345;
7
8    std::cout << std::fixed;
9    std::cout << std::setprecision(2);
10    std::cout << d;
11}
12
similar questions