Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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<<"YES
";
else
  cout<<"NO
";  
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #number #decimal #places
ADD COMMENT
Topic
Name
4+7 =