Answers for "c++ round to int"

C++
0

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;
}
Posted by: Guest on June-02-2020
6

nearest integer rounding in c++

cout << "Nearest value of x :" << round(x) << "\n";
Posted by: Guest on May-24-2020
0

rounding off to nearest integer in c++

double round(double x);
float round(float x);
long double round(long double x);
double round(T x); // For integral type
Posted by: Guest on July-07-2020

Browse Popular Code Answers by Language