Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: file is good in c++ 
Cpp :: move letter position using c++ with input 
Cpp :: code::block uncomment 
Cpp :: how to compile with libstdc++ fedora 
Cpp :: c++ trim string 
Cpp :: command loop ctrl D c++ 
Cpp :: easy way to encrypt a c++ file line by line 
Cpp :: fibonacci sequence c++ 
Cpp :: 2000pp pp play osu std 
Cpp :: cannot access base class members 
Cpp :: matrix chainmultiplication 
Cpp :: Maximum Cake Tastiness codeforces solution 
Cpp :: access the element of vector point2f c++ 
Cpp :: Extended Euclid Algorithm Recursive Solution 
Cpp :: inside information subtask 2 
Cpp :: The Three Topics codechef solution in c++ 
Cpp :: an array that take different data type c++ 
Cpp :: glm multiply vector by scalar 
Cpp :: type defination in C++ 
Cpp :: beecrowd problem 1004 solution 
Cpp :: C++ Features 
Cpp :: how to fixed how many digit will be after point in c++ 
Cpp :: Chef and IPC Certificates codechef solution in c++ 
Cpp :: bitmap rotate 90 deg 
Cpp :: tic tac toe in cpp 
Cpp :: c++ sort a 2d vector by column 
Cpp :: jquery ajax post json asp.net core 
Cpp :: iterator c++ 
Cpp :: deletion in bst 
Cpp :: equal elements in two arrays in c++ 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =