fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double a,b,result;
  9. a = 2;b = 3;
  10. result = a / b;
  11. cout << fixed << setprecision(2) << trunc(100*result)/100;
  12.  
  13. }
  14.  
Success #stdin #stdout 0s 4444KB
stdin
Standard input is empty
stdout
0.66