Answers for "setprecision cpp >>"

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
-1

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