Answers for "how to set precision decimal c++"

C++
0

set precision in c++

#include <iomanip.h>
#include <iomanip>
int main()
{
    double num1 = 3.12345678;
    cout << fixed << showpoint;
    cout << setprecision(2);
    cout << num1 << endl;
}
Posted by: Guest on September-16-2021

Code answers related to "how to set precision decimal c++"

Browse Popular Code Answers by Language