how to get 4 decimal places in c++
#include <iostream>
#include <iomanip>
int main() {
double number = 3.14159;
std::cout << std::fixed << std::setprecision(4) << number << std::endl;
return 0;
}
#include <iostream>
#include <iomanip>
int main() {
double number = 3.14159;
std::cout << std::fixed << std::setprecision(4) << number << std::endl;
return 0;
}