fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5.  
  6. int main(){
  7. float x = 2.958;
  8. cout << floorf(x * 10) / 10;
  9. return 0;
  10. }
  11.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
2.9