Answers for "how to increase precision c++ int"

C++
1

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
1

set precision in c++

#include <iostream>

int main()
{
  std::cout << std::setprecision(n); //to n SIG FIG
  // any cout comand will be to n sig fig after this comand
}
Posted by: Guest on January-17-2022

Browse Popular Code Answers by Language