Horje
how to print a decimal number upto 6 places of decimal in c++ Code Example
how to print a decimal number upto 6 places of decimal in c++
#include <iostream>
#include <iomanip>

int main()
{
    double d = 122.345;

    std::cout << std::fixed;
    std::cout << std::setprecision(2);
    std::cout << d;
}
how to print a decimal number upto 6 places of decimal in c++
788.98




Cpp

Related
setprecision in c++ Code Example setprecision in c++ Code Example
c++ get file content Code Example c++ get file content Code Example
find largest number in vector c++ Code Example find largest number in vector c++ Code Example
lpcwstr to string c++ Code Example lpcwstr to string c++ Code Example
‘setprecision’ was not declared in this scope Code Example ‘setprecision’ was not declared in this scope Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10