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

C++
#include <iostream>
#include <iomanip>

int main()
{
    double d = 122.345;

    std::cout << std::fixed;
    std::cout << std::setprecision(2);
    std::cout << d;
}std::cout << std::setprecision(2) << std::fixed;
// where the 2 is how many decimal places you want
// note you need to <iomanip>
Source

Also in C++: