Answers for "setprecision in c++"

C++
3

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
3

set precision with fixed c++

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

setprecision in c++

#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
  int i = 18;
  cout<<setw(10)i;
}
Posted by: Guest on August-29-2021

Browse Popular Code Answers by Language