How to print double without the decimal places in C++

1 Answer

0 votes
#include <iostream>
#include <iomanip>

int main() {
    double number = 28374092.401;

    std::cout << std::fixed << std::setprecision(0) << number;
}


  
/*
run:
  
28374092
 
*/

 



answered Nov 9, 2024 by avibootz

Related questions

...