Answers for "setprecision and fixed c++"

C++
5

setprecision in c++

#include<iomanip>
#include <iostream>
using namespace std;

int main()
{
   int num = 45;
  cout << "it is: " << fixed << setprecision(2) << num << " the end"<< endl;
  
  return 0;
}
Posted by: Guest on September-28-2020
6

set precision with fixed c++

int x = 109887;
cout << fixed << setprecision(3) << x;
Posted by: Guest on July-06-2020

Browse Popular Code Answers by Language