#include <iomanip>
// the rest of the code
double a = 4.032;
cout << fixed << setprecision(2);
cout << a;
// done;
int x = 109887;
cout << fixed << setprecision(3) << x;
Code Example |
---|
Cpp :: sin in c++ |
Cpp :: string to int in c++ |
Cpp :: c++ printf char as hex |
Cpp :: length of string c++ |
Cpp :: for loop with array c++ |
Cpp :: c++ return multiple values |
Cpp :: elements of set c++ |
Cpp :: random number generator c++ between 0 and 1 |
Cpp :: read text from file c++ |
Cpp :: footnote appears in the middle latex |
Cpp :: c++ template example |
Cpp :: remove last index of the string in c++ |
Cpp :: segmented sieve of Eratosthenes in cpp |
Cpp :: C++ array sort method |
Cpp :: ray sphere intersection equation |
Cpp :: c++ print string |
Cpp :: coordinate in 1d array c++ |
Cpp :: Xor implementation C++ |
Cpp :: size of array |
Cpp :: cin.getline |
Cpp :: how to declare a 2d boolean vector in c++ |
Cpp :: concat two vectors c++ |
Cpp :: cannot jump from switch statement to this case label c++ |
Cpp :: how to reverse a string in c++ |
Cpp :: to lowercase c++ |
Cpp :: c++ struct |
Cpp :: odd numbers 1 to 100 |
Cpp :: c++ reverse string |
Cpp :: ascii cpp |
Cpp :: how to print in new lines in C++ |