Answers for "c++ program to round off a decimal number"

C++
6

nearest integer rounding in c++

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

get number round off to two decimal places c++

float a,b,c,d,sum;

 cin>>a>>b>>c>>d; // reading decimal values

sum=(a*b*c*d);

sum=round(sum*100)/100; // here it is for 2 decimal points

if((float)sum < (float) 9.58)
  cout<<"YESn";
else
  cout<<"NOn";
Posted by: Guest on April-03-2021

Code answers related to "c++ program to round off a decimal number"

Browse Popular Code Answers by Language