how to print a decimal number upto 6 places of decimal in c++ how to print 4 digits after decimal in c++

The solution for “how to print a decimal number upto 6 places of decimal in c++ how to print 4 digits after decimal in c++” can be found here. The following code will assist you in solving the problem.

#include 
#include

int main()
{
double d = 122.345;

std::cout << std::fixed; std::cout << std::setprecision(2); std::cout << d; }cout<<"\n"<

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in