Clep Sydra
0
Q:

c++ round to int

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int x = 15;
    double result;
    result = round(x);
    cout << "round(" << x << ") = " << result << endl;

    return 0;
}
0
double round(double x);
float round(float x);
long double round(long double x);
double round(T x); // For integral type
0

New to Communities?

Join the community