Answers for "print float number with only four places after the decimal point in c++"

C++
0

print float number with only four places after the decimal point in c++

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
  value = 3.15647;
  std::cout << std::fixed << std::setprecision(2);
  std::cout<<value<<std::endl;
	return 0;
}
Posted by: Guest on March-10-2022

Code answers related to "print float number with only four places after the decimal point in c++"

Browse Popular Code Answers by Language