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
}
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
}
c++ round number to whole
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double num1 = 4.8;
double num2 = 4.3;
cout << round(num1) << endl; // --> 5
cout << round(num2) << endl; // --> 4
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us