Answers for "round to next integer in c++"

C++
2

c++ round number up

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	double num1 = 4.8;
  	double num2 = 4.3;
  	cout << ceil(num1) << endl; // --> 5
  	cout << ceil(num2) << endl; // --> 5
}
Posted by: Guest on August-28-2021

Code answers related to "round to next integer in c++"

Browse Popular Code Answers by Language